You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "This example illustrates roughly what code gets generated by the compiler, so the names do not conform to normal rules")]
public class RouglyHowEventsWork
{
private Action<string>? Announcement;
// Not the actual code.
// The real code is more complex, to tolerate concurrent calls.
public void add_Announcement(Action<string> handler)
{
Announcement += handler;
}
public void remove_Announcement(Action<string> handler)
{
Announcement -= handler;
}
public void Announce(string message) => this.Announcement?.Invoke(message);