Add an equivalent to VB.NET's Handles clause #3085
Replies: 5 comments
-
@alrz, that's an unrelated issue, I think. |
Beta Was this translation helpful? Give feedback.
-
sorry, I missed that this is about event handlers. |
Beta Was this translation helpful? Give feedback.
-
I like this idea and would be willing to draw up a prototype if anyone is interested. |
Beta Was this translation helpful? Give feedback.
-
I'd suggest that this is intentional in C#, especially since it has been this way since both C# 1.0 and VB.NET 1.0. The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In VB I can say this:
However in C# I can't add an event handler in this fashion; I have to add it in a separate line of code, which leads to fragmented code because the declaration of the event handler is separate from the registration of it as an event handler for a particular event:
I would like there to be added therefore an equivalent to VB's
Handles
clause, perhaps something like this:Beta Was this translation helpful? Give feedback.
All reactions