Пример #1
0
        static void Main(string[] args)
        {
            mymethod inv = new mymethod(print);

            inv.BeginInvoke(null, null); //Asynchronous calling
            Console.WriteLine("I am Back");
            Console.Read();
        }
Пример #2
0
        static void Main(string[] args)
        {
            inv = new mymethod(Print);
            //inv += Print2;
            IAsyncResult tag = inv.BeginInvoke(new AsyncCallback(Callback), null);

            Console.WriteLine("I am Back 1st");
            // Thread.Sleep(5000);
            Console.WriteLine("I am Back 2");
            Console.WriteLine("I am Back 3");

            while (flag)
            {
                Console.WriteLine("I am Back 3");
            }
            Console.Read();
        }
Пример #3
0
 static void Main(string[] args)
 {
     inv = new mymethod(Print);
     inv.BeginInvoke("ahmar", new AsyncCallback(Callback), null);
     Console.ReadLine();
 }
Пример #4
0
 static void CallAsyncTest()
 {
     inv = new mymethod(Print);
     inv.BeginInvoke("Ranjeet", new AsyncCallback(Callback), null);
     Console.ReadLine();
 }