/get-object-value.vb Secret
Created
February 3, 2019 13:04
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class MyEventArgs | |
Property Value As Object | |
End Class | |
Structure MyStruct | |
Public X, Y As Integer | |
End Structure | |
Module Program | |
Sub Main() | |
Dim defaultValue As Object = New MyStruct With {.X = 3, .Y = 5} | |
Dim e = New MyEventArgs With {.Value = defaultValue} | |
RaiseEvent DoSomething(Nothing, e) | |
If e.Value Is defaultValue Then | |
' No handlers have changed anything. | |
Console.WriteLine("Unchanged.") | |
End If | |
End Sub | |
Event DoSomething(sender As Object, e As MyEventArgs) | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment