static void Main(string[] args){
   // C# 1.0
   Delegate10 del10 = new Delegate10(StaticHello);
   del10("This function create new delegatetion of C#.0");
   // C#2.0
   Delegate10 del20 = StaticHello;
   del20("C#2.0からデリゲートの作成はnew演算子を使わなくでも代入できるのだ!");
   
   var foo = new Foo();
   // Declare delegate
   HelloDelegate funcs;
   funcs = foo.Hello;
   funcs += StaticHello;
   // C#3.0 lambda Expresstion
   funcs += (string name) => {
     Console.WriteLine("(lambda) : Hello {0}",name);
   };
   // C#3.0 組込delegate型
   Action<string> tlambda = str => { Console.WriteLine(str);};
   // Castting To HelloDelegate 
   funcs += new HelloDelegate( tlambda);
   // NG : funcs += (HelloDelegate) tlambda;
   //型推論で省略できる。
   funcs += str => {Console.WriteLine(str);};
   // C#2.0 Anonymouse Method
   funcs += delegate(string name){
     Console.WriteLine("(delegate) : Hello {0}",name);
   };
   funcs("World");
   }
 private void method_17(Class1157 A_0, Delegate10 A_1)
 {
     if ((A_0 != null) && ((!A_0.method_8() || !A_0.method_0().method_8()) || !A_0.method_2().method_8()))
     {
         if (!A_0.method_8())
         {
             A_1(A_0);
         }
         this.method_17(A_0.method_0(), A_1);
         this.method_17(A_0.method_2(), A_1);
     }
 }
Beispiel #3
0
 public void imethod_0(int index, Delegate10 binder)
 {
     if (index < 0)
     {
         binder((Class80)null);
     }
     else if (index < this.ilist_0.Count)
     {
         binder(this.ilist_0[index]);
     }
     else
     {
         IList <Delegate10> delegate10List;
         if (!this.idictionary_0.TryGetValue(index, out delegate10List))
         {
             delegate10List = (IList <Delegate10>) new List <Delegate10>();
             this.idictionary_0.Add(index, delegate10List);
         }
         delegate10List.Add(binder);
     }
 }
Beispiel #4
0
 public void imethod_0(int index, Delegate10 binder)
 {
     this.interface6_0.imethod_0(index, binder);
 }
 internal void method_16(Delegate10 A_0)
 {
     this.method_17(this.class1157_0, A_0);
 }
Beispiel #6
0
 public Class126(TimeSpan delay, TimeSpan interval, int count, Delegate10 callback) : base(delay, interval, count)
 {
     this.delegate10_0 = callback;
     this.vmethod_0();
 }
Beispiel #7
0
        public static TimerClass smethod_6(TimeSpan timeSpan_2, TimeSpan timeSpan_3, int int_4, Delegate10 delegate10_0)
        {
            TimerClass class2 = new Class126(timeSpan_2, timeSpan_3, int_4, delegate10_0);

            if (int_4 == 1)
            {
                class2.Priority = smethod_3(timeSpan_2);
            }
            else
            {
                class2.Priority = smethod_3(timeSpan_3);
            }
            class2.method_1();
            return(class2);
        }
Beispiel #8
0
 public static TimerClass smethod_5(TimeSpan timeSpan_2, TimeSpan timeSpan_3, Delegate10 delegate10_0) =>
 smethod_6(timeSpan_2, timeSpan_3, 0, delegate10_0);
Beispiel #9
0
 public static TimerClass smethod_4(TimeSpan timeSpan_2, Delegate10 delegate10_0) =>
 smethod_6(timeSpan_2, TimeSpan.Zero, 1, delegate10_0);