Skip to content

C# -> VB: some missing code when convert  #377

Description

@chinhdai

Input code

public partial class RefEditForm : Form
            Closed += delegate
            {
                _selectionTracker.NewSelection -= ChangeText;
                _selectionTracker.Stop();
            };
Dispatcher.Invoke(new Action(() =>
            {
                _refEditWindow2.Dispatcher.Invoke(new Action(() => _refEditWindow2.Activate()));
            }

Erroneous output

    Public Partial Class RefEditForm
        Inherits Form
            AddHandler ClosedEvent, Sub()
                                        RemoveHandler _selectionTracker.NewSelection, AddressOf ChangeText
                                        _selectionTracker.[Stop]()
                                    End Sub
Dispatcher(New Action(Sub()
_refEditForm2(New Action(Sub() _refEditForm2.Activate()))

Expected output

   Partial Class RefEditForm
        Inherits Form
            AddHandler Closed, Sub()
                                        RemoveHandler _selectionTracker.NewSelection, AddressOf ChangeText
                                        _selectionTracker.[Stop]()
                                    End Sub
Dispatcher.Invoke(New Action(Sub()
_refEditForm2.Invoke(New Action(Sub() _refEditForm2.Activate()))

Details

  • Unknown issue to do with "Public"
  • Shoud say "Closed" instead of "ClosedEvent"
  • Missing ".Invoke"

Metadata

Metadata

Assignees

No one assigned

    Labels

    C# -> VBSpecific to C# -> VB conversioncompilation errorA bug where the converted output won't compileneeds-reproNeeds either the input that caused the error, or more information to allow reproducing the error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions