Exemplo n.º 1
0
 public void AddErrLine(string line)
 {
     if (addErrDelegate == null)
     {
         addErrDelegate = new ShowTextDelegate(AddErrLineImp);
     }
     this.Dispatcher.Invoke(addErrDelegate, line);
     DoEvents();
 }
Exemplo n.º 2
0
 public void SetStatusMessage(string message)
 {
     if (setStatusDelegate == null)
     {
         setStatusDelegate = new ShowTextDelegate(SetStatusMessageImp);
     }
     this.Dispatcher.Invoke(setStatusDelegate, message);
     DoEvents();
 }
Exemplo n.º 3
0
        public void ShowText(RichTextBox rtb, string str)
        {
            ShowTextDelegate std = new ShowTextDelegate(ShowText);

            if (rtb.InvokeRequired)
            {
                rtb.Invoke(std, new object[] { rtb, str });
            }
            else
            {
                rtb.Text += str;
            }
        }
Exemplo n.º 4
0
        static void Main()
        {
            MyDelegate d = null;

            d += Method1;
            d += Method2;
            d.Invoke();

            ShowTextDelegate d2 = new ShowTextDelegate(ShowText);

            d2("Hello World...");

            SumDelegate d3     = new SumDelegate(Sum);
            int         result = d3.Invoke(12, 15);

            Console.WriteLine(result);
        }
Exemplo n.º 5
0
        void GetResult(IAsyncResult result)
        {
            //AsyncMethodCaller caller = (AsyncMethodCaller)((AsyncResult)result).AsyncDelegate;

            AsyncMethodCaller caller = (AsyncMethodCaller)((AsyncResult)result).AsyncDelegate;
            string res=caller.EndInvoke(result);

            ShowTextDelegate showText = new ShowTextDelegate(ShowText);
            txbComment.Invoke(showText, res);
        }
Exemplo n.º 6
0
        public AsyncTest()
        {
            InitializeComponent();

            _delegate = new ShowTextDelegate(ShowText);
        }