public void Cancell() { lock (_lockobject) { _cancelled = true; _state = DepState.DepPause; } }
public void Begin(int vol) { lock (_lockobject) { _volume = vol; _currVol = 0; _state = DepState.DepStart; } }
public void Work() { while (_bContinue) { switch (_state) { case DepState.DepStart: if(CanStart()) _state = DepState.DepWork; break; case DepState.DepAbort: _state = DepState.DepWait; break; case DepState.DepWork: GetCurrVol(); _context.Send(OnDepChanged, _currVol); if (_currVol >= _volume) { DoEnd(_currVol); _state = DepState.DepWait; } //_context.Send(OnWorkCompleted, _cancelled); break; case DepState.DepPause: // _context.Send(OnWorkCompleted, _cancelled); break; } } }
public void Continue(int currV) { _state = DepState.DepWork; }
public void Abort(int currV) { DoEnd(_currVol); _state = DepState.DepWait; }
public DepLogic(SynchronizationContext context) : this(0, 0, 0) { _state = DepState.DepWait; _context = context; _bContinue = true; }