public void AddErrLine(string line) { if (addErrDelegate == null) { addErrDelegate = new ShowTextDelegate(AddErrLineImp); } this.Dispatcher.Invoke(addErrDelegate, line); DoEvents(); }
public void SetStatusMessage(string message) { if (setStatusDelegate == null) { setStatusDelegate = new ShowTextDelegate(SetStatusMessageImp); } this.Dispatcher.Invoke(setStatusDelegate, message); DoEvents(); }
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; } }
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); }
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); }
public AsyncTest() { InitializeComponent(); _delegate = new ShowTextDelegate(ShowText); }