예제 #1
0
 public static int Main()
 {
     int iret = 100;
     DelegateStruct ds = new DelegateStruct();
     DelSt d = new DelSt(ds.DelMethod_Inline);
     TestStruct ts;
     ts.f1 = 1;
     ts.f2 = 1;
     TestStruct tr = d(ts, 10);
     Console.WriteLine("tr f1={0} f2={1}", tr.f1, tr.f2);
     if (tr.f1 != 10 || tr.f2 != 20)
     {
         Console.WriteLine("FAIL");
         iret = 1;
     }
     else
     {
         Console.WriteLine("PASS");
     }
     return iret;
 }
예제 #2
0
    public static int Main()
    {
        int            iret = 100;
        DelegateStruct ds   = new DelegateStruct();
        DelSt          d    = new DelSt(ds.DelMethod_Inline);
        TestStruct     ts;

        ts.f1 = 1;
        ts.f2 = 1;
        TestStruct tr = d(ts, 10);

        Console.WriteLine("tr f1={0} f2={1}", tr.f1, tr.f2);
        if (tr.f1 != 10 || tr.f2 != 20)
        {
            Console.WriteLine("FAIL");
            iret = 1;
        }
        else
        {
            Console.WriteLine("PASS");
        }
        return(iret);
    }