コード例 #1
0
ファイル: Program.cs プロジェクト: hamidrezakaveii/CSharpRepo
        static void Main(string[] args)
        {
            delegateParam myDelegate = new delegateParam(methodForDelegate);

            methodService(myDelegate, "Hami");
            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            delegateParam sonDelgate = new delegateParam(methodeAdelegateProduite);

            methodeService(sonDelgate, "helloooooooo");
            Console.ReadKey();
        }
コード例 #3
0
        public static byte[] InvokeDelegate(object[] args)
        {
            byte[] address      = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 };
            byte[] contractAddr = (byte[])args[1];
            byte[] from         = (byte[])args[2];
            byte[] to           = (byte[])args[3];
            byte[] role         = (byte[])args[4];
            int    period       = (int)args[5];
            int    level        = (int)args[6];
            int    keyNo        = (int)args[7];

            object[] param = new object[1];
            param[0] = new delegateParam {
                ContractAddr = contractAddr, From = from, To = to, Role = role,
                Period       = period, Level = level, KeyNo = keyNo
            };

            return(Native.Invoke(0, address, "delegate", param));
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: hamidrezakaveii/CSharpRepo
 private static void methodService(delegateParam p, string txt)
 {
     Console.WriteLine(txt + " The result is: {0:f2}", p(10.0, 4));
 }