-
-
Save LaraSQP/00345ef063f14ff2faf759b3560e4f61 to your computer and use it in GitHub Desktop.
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 Example | |
| { | |
| public event EventHandler<string> PassString; | |
| public event EventHandler<( Keys key, int x, bool modified )> PassMultipleValues; | |
| private void NotifySubscribers() | |
| { | |
| PassString?.Invoke( this, "some text" ); | |
| PassMultipleValues?.Invoke( this, ( Keys.Up, 1, true ) ); | |
| } | |
| } | |
| ... | |
| public class Main | |
| { | |
| private Example _example = new(); | |
| public Main() | |
| { | |
| _example.PassString += OnPassString(); | |
| _example.PassMultipleValues += ( _, e ) => SomeOtherMethod( e.key, e.x, e.modified ); | |
| } | |
| private void OnPassString( object sender, string text ) | |
| { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment