Last active
February 9, 2021 16:07
-
-
Save OnSive/11aa56142fb33f2b049ea85a002ddcda to your computer and use it in GitHub Desktop.
[Custom event] A full custom event #Event
This file contains hidden or 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
| Public Class FooBar | |
| Public Delegate Sub FooBarChanged(sender As Object, e As FooBarEventArgs) | |
| Public Event OnFooBarChange As FooBarChanged | |
| Private Sub RaiseEvent() | |
| RaiseEvent OnFooBarChange(Me, new FooBarEventArgs(123)) | |
| End Sub | |
| End Class |
This file contains hidden or 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
| Public Class FooBarEventArgs | |
| Inherits EventArgs | |
| Public ReadOnly Property MyProperty As Integer | |
| Friend Sub New(ByVal MyProperty As Integer) | |
| MyBase.New() | |
| Me.MyProperty = MyProperty | |
| End Sub | |
| End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment