static void Main(string[] args) { TheEvent += Program_TheEvent; Console.WriteLine("Enter something:"); var something = Console.ReadLine(); if (something.ToLower().Contains("the")) { TheEvent?.Invoke(null, something); } }
public void RaiseTheEvent(EventArgs eventArgs) { TheEvent?.Invoke(this, eventArgs); }
protected void OnTheEvent([CallerMemberName] string name = "") { TheEvent?.Invoke(this, new TestEventArgs(name)); }
public void Fire(object sender, T data) { TheEvent?.Invoke(sender, new EventArgs <T>(data)); }
public void Raise() { TheEvent?.Invoke(); }