Hey
I have a suggestion of improving the Mercury Language in relation to the Standard MS VB.NET behaviour.
In VB.Net it is possible to use AddHandler with Inline Declaration like this:
AddHandler UserControl.ProgressChanged, Sub(Progress)
frm.ProgressBar.Value = Progress.Value
End Sub
This is working in classic VB.Net - The Problem with that is, that there is no possibility to Remove this handler anymore.
So it would be cool to have such a feature to Remove Inline coded Handler.
Private MyHandler = Sub(Progress) frm.ProgressBar.Value = Progress.Value
Sub AddHandlerSub
AddHandler UserControl.ProgressChanged, MyHandler
End Sub
Sub RemoveHandlerSub
RemoveHandler UserControl.ProgressChanged, MyHandler
End Sub
OR simpler - without the variable, but it will erase all attached handlers:
Sub AddHandlerSub
AddHandler UserControl.ProgressChanged, Sub(Progress) frm.ProgressBar.Value = Progress.Value
End Sub
Sub RemoveHandlerSub
UserControl.ProgressChangedEvent = Nothing 'Or Null in Mercury
End Sub