IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { TransferAsyncResult result = new TransferAsyncResult(callback, state); Executer exe = new Executer(result, command); Thread thread = new Thread(new ThreadStart(exe.Execute)); thread.Start(); return result; }
internal Executer(TransferAsyncResult asyncResult, BaseCommand command) { this._asyncResult = asyncResult; this._command = command; }
static IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { TransferAsyncResult result = new TransferAsyncResult(callback, state); Executer exe = new Executer(result, command); ThreadPool.QueueUserWorkItem(s => exe.Execute()); return result; }
internal Executer(AsyncCallback callback, object state, BaseCommand command) : this(new TransferAsyncResult(callback, state), command) { }
static IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { Executer exe = new Executer(callback, state, command); ThreadPool.QueueUserWorkItem(s => exe.Execute()); return exe.AsyncResult; }