Example #1
0
        public static void Main()
        {
            wd matha = a =>
            {
                int fact = 0;
                for (int i = a; i > 0; i--)
                {
                    if (i == a)
                    {
                        fact = i;
                    }
                    else
                    {
                        fact *= i;
                    }
                }
                return(fact);
            };

            matha += a =>
            {
                int r  = a * a;
                int r1 = r * a;
                return(r1);
            };
            matha += a => a * a;
            foreach (wd m in matha.GetInvocationList())
            {
                Console.WriteLine(m.Method + " " + m.Invoke(3));
            }

            Console.ReadLine();
        }
Example #2
0
    static void Main(string[] args)
    {
        Account[] a = new Account[3];

        a[0] = new Saving("A", 35000);
        a[1] = new Saving("B", 18000);
        a[2] = new Current("C", 40000);

        wd w = (amt, Balance, name) =>
        {
            Console.WriteLine("E-mail : Amount withdrawn : {0} new bal={1} name={2}", amt, Balance, name);
        };

        w += (amt, Balance, name) =>
        {
            Console.WriteLine("Mobile : Amount withdrawn : {0} new bal={1} name={2}", amt, Balance, name);
        };

        for (int i = 0; i < a.Length; i++)
        {
            a[i].wdevent += w;
        }


        a[0].deposit(10000);
        a[1].withdraw(1000);
        a[2].withdraw(12000);
    }
Example #3
0
        public static void Main()
        {
            wd matha = new wd(math.factorial);

            matha += new wd(math.cube);
            matha += new wd(math.square);
            foreach (wd m in matha.GetInvocationList())
            {
                Console.WriteLine(m.Method + " " + m.Invoke(3));
            }

            Console.ReadLine();
        }
Example #4
0
        public static void Main()
        {
            anno a   = new anno();
            wd   evt = a.fact;

            evt += a.sqr;
            evt += a.cube;
            foreach (wd m in evt.GetInvocationList())
            {
                Console.WriteLine(m.Method + " " + m.Invoke(3));
            }

            Console.ReadLine();
        }
Example #5
0
        public static void Main()
        {
            math math = new math();            //-----------create instance of math class

            wd matha = new wd(math.factorial); //---------assign handler by instance

            matha += new wd(math.cube);
            matha += new wd(math.square);
            foreach (wd m in matha.GetInvocationList())
            {
                Console.WriteLine(m.Method + " " + m.Invoke(3));
            }

            Console.ReadLine();
        }
Example #6
0
        public Iwd Create(
            ImmutableList <IwdCrossJoinElement> value)
        {
            Iwd crossJoin = null;

            try
            {
                crossJoin = new wd(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(crossJoin);
        }
Example #7
0
    static void Main(string[] args)
    {
        Account[] a = new Account[3];

        a[0] = new Saving("A", 35000);
        a[1] = new Saving("B", 18000);
        a[2] = new Current("C", 40000);

        wd w = (amt, Balance, name) =>
        {
            Console.WriteLine("E-mail : Amount withdrawn : {0} new bal={1} name={2}", amt, Balance, name);
        };

        w += (amt, Balance, name) =>
        {
            Console.WriteLine("Mobile : Amount withdrawn : {0} new bal={1} name={2}", amt, Balance, name);
        };

        for (int i = 0; i < a.Length; i++)
        {
            a[i].wdevent += w;
        }


        a[0].deposit(10000);
        a[1].withdraw(1000);
        a[2].withdraw(12000);

        Console.WriteLine("Serialization");

        Account.SaveAsSoapFormat(a);

        Console.WriteLine("De-Serialization");

        String s = "emp.soap";

        Account.LoadFrormFile(s);

        Console.WriteLine("done");
    }
Example #8
0
 var(wd, err)  = syscall.Getwd();
Example #9
0
 : dsl is BankingFree <A> .Withdraw wd?Withdraw(wd, bank)
     : dsl is BankingFree <A> .Deposit de?Deposit(de, bank)