Пример #1
0
 public void PublishMessage()
 {
     if (ShowDelegateEvent != null)
     {
         var length = ShowDelegateEvent.GetInvocationList().Length;
         ShowDelegateEvent.Invoke(length, true);
     }
 }
Пример #2
0
        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);
        }