コード例 #1
0
ファイル: MainForm.cs プロジェクト: lipavashka/VS2013_Mono
 void ParseMessageOverDelegate(string msg)
 {
     Thread.Sleep(1000);
     AppendTextBox(msg);
     try
     {
         sd.EndInvoke(asyncRes);
     }
     catch { }
 }
コード例 #2
0
ファイル: EndInvokePattern.cs プロジェクト: git-thinh/appie
        static void Main(string[] args)
        {
            SomeDelegate sd = SquareNumber; // Create delegate instance

            Console.WriteLine("Before SquareNumber Method Invoke");
            IAsyncResult asyncRes = sd.BeginInvoke(10, null, null);

            Console.WriteLine("Back to Main Method");
            int res = sd.EndInvoke(asyncRes);

            Console.WriteLine(res);
            Console.ReadLine();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: ShartepStudy/C_sharp
        static void Main(string[] args)
        {
            SomeDelegate sd = SquareNumber; // Создаем делегат

            Console.WriteLine("Перед вызовом SquareNumber");
            IAsyncResult asyncRes = sd.BeginInvoke(10, null, null);

            Console.WriteLine("Возвращаемcя в главный метод");
            int res = sd.EndInvoke(asyncRes);

            Console.WriteLine(res);
            Console.ReadLine();
        }