Esempio n. 1
0
        private void validateAndUploadProfileImages1(bool onlyValidate)
        {
            rtbDisplay.Clear();

            //--validate web URL
            SPWeb web = Util.RetrieveWeb(txtTargetSite.Text, rtbSiteValidateMessage);

            if (web == null)
            {
                return;
            }

            if (!Directory.Exists(txtLocalSourceDir.Text))
            {
                AddToRtbLocal("Source Folder " + txtLocalSourceDir.Text + " does not exist\r\n", StyleType.bodyRed);
                return;
            }

            //--
            _cancelNotice = false;
            Util.ToggleCancelLink(Util.ToggleCancelState.begin, lnkCancel);

            //-- call asynchronously
            del1 d1 = new del1(validateAndUploadProfileImages2);

            d1.BeginInvoke(onlyValidate, cboPictureLibName.Text, null, null);
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Program p1  = new Program();
            del1    obj = new del1(Show);

            obj();
            Console.WriteLine("result");
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            del1       d;
            Delegates1 s1 = new Delegates1();

            d = new del1(ref s1.MyFun);
            d(10);
        }
Esempio n. 4
0
        public void lambda()
        {
            del1 bar = this.bar(3);

            Console.WriteLine(bar());
            Console.WriteLine(bar());
            Console.WriteLine(this.bar(4)());
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            del1 obj = new del1(imath.add);

            obj.Invoke(5, 7);
            Console.WriteLine("***************************");
            obj(5, 7);
            Console.ReadLine();
        }
Esempio n. 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //del1 d1 = new del1(method1);
            //d1();

            //added multi methods to a delegate to create multi cast delegate
            del1 d2 = new del1(method1);//multi cast delegates
            d2 += method2;
            d2 += method3;
            d2();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            del1 d = new del1(func);

            d += func2;
            d(10, 12);
            d -= func;
            d -= func;
            d(10, 12);
            Console.ReadKey();
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            //del1 d1 = new del1(method1);
            //d1();

            //added multi methods to a delegate to create multi cast delegate
            del1 d2 = new del1(method1);//multi cast delegates

            d2 += method2;
            d2 += method3;
            d2();
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            del1 obj = new del1(imath.add);

            obj += new del1(imath.sub);
            obj += new del1(imath.mul);
            obj += new del1(imath.div);

            obj.Invoke(20, 30);
            Console.WriteLine("*****************************");
            obj -= new del1(imath.sub);
            obj.Invoke(20, 30);
        }
Esempio n. 10
0
        public static void testMetric1()
        {
            // Lambda used for delegate
            Func <int, bool> myFunc      = x => x == 5;
            del1             myDelegate1 = x => x * x;
            del2             myDelegate2 = x => x == 5;

            Console.WriteLine(myDelegate1(2));
            Console.WriteLine(myDelegate2(5));
            Console.WriteLine(myFunc(5));

            // Lambda used for Expression<Func> (linq operators accept Expression<Func<TSource>>)
            // TO BE Updated
        }
        static void Main(string[] args)
        {
            del1 handler1 = x => x * x;

            Console.WriteLine("Task 1: " + handler1(5) + "\n");

            del2 handler2 = (x1, x2, x3) => x1 + x2 + x3;

            Console.WriteLine("Task 2: " + handler2(5.12f, 6.31f, 1.17f) + "\n");

            del3 handler3 = () => "hello";

            Console.WriteLine("Task 3: " + handler3());
        }
Esempio n. 12
0
        public void method1(del1 <Experimental.Models.model, int> del)
        {
            List <Experimental.Models.model> models = new List <Experimental.Models.model>()
            {
                new Experimental.Models.model()
                {
                    Id = 1, name = "pradeep"
                }, new Experimental.Models.model()
                {
                    Id = 2, name = "panigrahy"
                }
            };

            var result = del(models);
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            del1 handler = DelegateStringMethod;

            handler();

            del2  handler2  = DelegateFloatMethod;
            float del2Float = handler2();

            Console.WriteLine("\n" + del2Float);

            del3 handler3 = DelegateNoReturn;

            handler3("hey", 122, 1.12f);
        }
Esempio n. 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            del1 d1 = new del1(method1);//pass address with no params par
            d1();

            del2 d2 = new del2(method2);
            d2(5);

            del2 d3;
            d3 = method2;
            d3(12);

            del3 dAdd;
            dAdd = method3;
            int res = dAdd(4, 5);
            MessageBox.Show("method3 "+res);
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            Ashfaaq a = new Ashfaaq();

            del1 d = a.AddNum;

            Console.WriteLine(d(3, 4));

            d = a.MulNum;
            Console.WriteLine(d(3, 4));

            Ashfaaq2 a2 = new Ashfaaq2();
            del2     d2 = a2.Check;

            Console.WriteLine(d2("True"));
        }
Esempio n. 16
0
        private void button1_Click(object sender, EventArgs e)
        {
            del1 d1 = new del1(method1);//pass address with no params par

            d1();

            del2 d2 = new del2(method2);

            d2(5);

            del2 d3;

            d3 = method2;
            d3(12);

            del3 dAdd;

            dAdd = method3;
            int res = dAdd(4, 5);

            MessageBox.Show("method3 " + res);
        }
Esempio n. 17
0
 public void setDelegate()
 {
     del1 objDel = fn1;
 }
Esempio n. 18
0
        static void Main(string[] args)
        {
            del1 fun1 = new del1(display);

            fun1("From Mars");
        }
Esempio n. 19
0
        private void validateAndUploadProfileImages1(bool onlyValidate)
        {
            rtbDisplay.Clear();

            //--validate web URL
            SPWeb web = Util.RetrieveWeb(txtTargetSite.Text, rtbSiteValidateMessage);
            if (web == null) return;

            if (!Directory.Exists(txtLocalSourceDir.Text))
            {
                AddToRtbLocal("Source Folder " + txtLocalSourceDir.Text + " does not exist\r\n", StyleType.bodyRed);
                return;
            }

            //--
            _cancelNotice = false;
            Util.ToggleCancelLink(Util.ToggleCancelState.begin, lnkCancel);

            //-- call asynchronously
            del1 d1 = new del1(validateAndUploadProfileImages2);
            d1.BeginInvoke(onlyValidate, cboPictureLibName.Text, null, null);
        }