void Quit_End(IAsyncResult ar) { Disconnect_SO stateObj = (Disconnect_SO)ar.AsyncState; try { stateObj.UpdateContext(); _cmdQuit.EndExecute(ar); } catch (Exception e) { stateObj.Exception = e; } stateObj.SetCompleted(); }
void Reset_End(IAsyncResult ar) { Disconnect_SO stateObj = (Disconnect_SO)ar.AsyncState; try { stateObj.UpdateContext(); _cmdReset.EndExecute(ar); _cmdQuit.BeginExecute(stateObj.Timeout, new AsyncCallback(Quit_End), stateObj); } catch (Exception e) { stateObj.Exception = e; stateObj.SetCompleted(); } }