/// <summary> /// /// </summary> internal void OnCallback() { try { NotifyCallback handler = Callback; if (handler != null) { handler.BeginInvoke(this, EndCallback, null); } } catch (Exception ex) { TraceLog.WriteError("Notify callback error:{0}", ex); } }
static void Main(string[] args) { //AsyncWrite(); AsyncWrite2(); if (Notify != null) { IAsyncResult asyncResult = Notify.BeginInvoke( " ", 1, 2, null, Notify); // ... Notify.EndInvoke(asyncResult); } Console.ReadLine(); }