예제 #1
0
        private static void DoEvents()
        {
            DelegateType1 method = DoEventsInternal;

            Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, method);
            //Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
        }
예제 #2
0
        private void ShowMessageBoxOnClose()
        {
            DelegateType1 method = SendCancelationEvent;

            if (MessageBox.Show(Properties.Resources.txtPromptPrintAbort, Properties.Resources.InfoHeader, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            {
                Dispatcher.BeginInvoke(method);
            }
        }
예제 #3
0
        private void PrintProgress_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            e.Cancel = true;
            DelegateType1 method = ShowMessageBoxOnClose;

            Dispatcher.BeginInvoke(method);
            //Dispatcher.BeginInvoke(new Action(() =>
            //{
            //	if (MessageBox.Show(Properties.Resources.txtPromptPrintAbort, Properties.Resources.InfoHeader, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            //		Dispatcher.BeginInvoke(new Action(() => { if (NeedStopPrinting != null) NeedStopPrinting(this, EventArgs.Empty); }));
            //}));
        }
예제 #4
0
        static void Zad8()
        {
            delegateName1 = new DelegateType1(SilniaIT);
            IAsyncResult ar     = delegateName1.BeginInvoke(10, null, null);
            int          result = delegateName1.EndInvoke(ar);

            Console.WriteLine("it: " + result);

            delegateName2 = new DelegateType1(SilniaR);
            IAsyncResult ar2     = delegateName1.BeginInvoke(10, null, null);
            int          result2 = delegateName1.EndInvoke(ar2);

            Console.WriteLine("rek: " + result2);

            Thread.Sleep(2000);
        }
 private void HandleThis(HomeModel model, DelegateType1 d, int i)
 {
     d(i);
 }