public override void Close() { if (null != MonitorTimer) { MonitorTimer.Stop(); MonitorTimer = null; } }
public override bool Start() { if (null != MonitorTimer) { MonitorTimer.Stop(); } MonitorTimer = new Timer(); MonitorTimer.Interval = ConstCodeHelper.MONITOR_INTERVAL; MonitorTimer.Elapsed += MonitorTimer_Elapsed; MonitorTimer.Start(); return(true); }
/// <summary> /// Disposes this instance. /// </summary> /// <param name="disposing">A value indicating whether disposal is in progress.</param> protected virtual void Dispose(bool disposing) { if (!Disposed) { if (disposing) { MonitorTimer.Stop(); MonitorTimer.Dispose(); CancelAll(); } Disposed = true; } }