none
What is difference between calling delegate using invoke,DynamicInvoke and normal delegate call RRS feed

  • Question

  • Hi,

              What is the difference between these delegate calls.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    
    namespace DelegateSample
    {
        class Program
        {
            delegate void SampleDelegate(int i);
            static void DoSomething(int a) { Console.WriteLine(a); }
            static void Main()
            {
                SampleDelegate method = DoSomething;
                object i = 9;
                int a = 10;
                method(a);
                method.DynamicInvoke(i);
                method.Invoke(a);
                Console.ReadKey();
            }
        }
    }
    

    Saturday, July 6, 2013 6:50 AM

Answers

All replies