internal void Execute() { try { this._command.Execute(); this._asyncResult.Return = this._command.Return; } catch (Exception e) { this._asyncResult.LastException = e; } finally { this._asyncResult.SignalWaitHandle(); if (this._asyncResult.Callback != null) { this._asyncResult.Callback(this._asyncResult); } } } }
static IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { Executer exe = new Executer(callback, state, command); ThreadPool.QueueUserWorkItem(s => exe.Execute()); return(exe.AsyncResult); }