public void PublishMessage() { if (ShowDelegateEvent != null) { var length = ShowDelegateEvent.GetInvocationList().Length; ShowDelegateEvent.Invoke(length, true); } }
public static void Main() { ShowDelegate display = Number; // ShowDelegate display = new ShowDelegate(Number); display(42); display(100); display.Invoke(50); System.Console.WriteLine("Delgate object: {0}", returnNum()); display = Money; display(42); display(200); System.Console.WriteLine("Delegate object: {0}", returnNum() / 42); }