@@ -608,5 +608,99 @@ public int TestConversion(object ai_ID)
608608}
609609" ) ;
610610 }
611+
612+ [ Fact ]
613+ public async Task Test_Issue701_MultiLineHandlesSyntaxAsync ( )
614+ {
615+ await TestConversionVisualBasicToCSharpAsync ( @"Public Class Form1
616+ Private Sub MultiClickHandler(sender As Object, e As EventArgs) Handles Button1.Click,
617+ Button2.Click
618+ End Sub
619+ End Class
620+
621+ Partial Class Form1
622+ Inherits System.Windows.Forms.Form
623+
624+ Private Sub InitializeComponent()
625+ Me.Button1 = New System.Windows.Forms.Button()
626+ Me.Button2 = New System.Windows.Forms.Button()
627+ End Sub
628+
629+ Friend WithEvents Button1 As System.Windows.Forms.Button
630+ Friend WithEvents Button2 As System.Windows.Forms.Button
631+ End Class" ,
632+ @"using System;
633+ using System.Runtime.CompilerServices;
634+
635+ public partial class Form1
636+ {
637+ private void MultiClickHandler(object sender, EventArgs e)
638+ {
639+ }
640+ }
641+
642+ public partial class Form1 : System.Windows.Forms.Form
643+ {
644+ private void InitializeComponent()
645+ {
646+ _Button1 = new System.Windows.Forms.Button();
647+ _Button1.Click += new EventHandler(MultiClickHandler);
648+ _Button2 = new System.Windows.Forms.Button();
649+ _Button2.Click += new EventHandler(MultiClickHandler);
650+ }
651+
652+ private System.Windows.Forms.Button _Button1;
653+
654+ internal System.Windows.Forms.Button Button1
655+ {
656+ [MethodImpl(MethodImplOptions.Synchronized)]
657+ get
658+ {
659+ return _Button1;
660+ }
661+
662+ [MethodImpl(MethodImplOptions.Synchronized)]
663+ set
664+ {
665+ if (_Button1 != null)
666+ {
667+ _Button1.Click -= MultiClickHandler;
668+ }
669+
670+ _Button1 = value;
671+ if (_Button1 != null)
672+ {
673+ _Button1.Click += MultiClickHandler;
674+ }
675+ }
676+ }
677+
678+ private System.Windows.Forms.Button _Button2;
679+
680+ internal System.Windows.Forms.Button Button2
681+ {
682+ [MethodImpl(MethodImplOptions.Synchronized)]
683+ get
684+ {
685+ return _Button2;
686+ }
687+
688+ [MethodImpl(MethodImplOptions.Synchronized)]
689+ set
690+ {
691+ if (_Button2 != null)
692+ {
693+ _Button2.Click -= MultiClickHandler;
694+ }
695+
696+ _Button2 = value;
697+ if (_Button2 != null)
698+ {
699+ _Button2.Click += MultiClickHandler;
700+ }
701+ }
702+ }
703+ }" , hasLineCommentConversionIssue : true ) ;
704+ }
611705 }
612706}
0 commit comments