예제 #1
0
파일: Program.cs 프로젝트: cenyG/Chapter15
        static void Main(string[] args)
        {
            Factorial fact_delegate = new Factorial(FactorialFunc);
            IAsyncResult result = fact_delegate.BeginInvoke(10, new AsyncCallback(CallBack), "Это параметр");

            Console.WriteLine("Можете что-то ввести:");
            Console.ReadLine();

            int fact = fact_delegate.EndInvoke(result);

            Console.WriteLine("Результат: {0}", fact);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Factorial    fact_delegate = new Factorial(FactorialFunc);
            IAsyncResult result        = fact_delegate.BeginInvoke(10, new AsyncCallback(CallBack), "Это параметр");

            Console.WriteLine("Можете что-то ввести:");
            Console.ReadLine();

            int fact = fact_delegate.EndInvoke(result);

            Console.WriteLine("Результат: {0}", fact);
        }