public static void DisposeTimer( ref SimpleTimer oTimer) { if (oTimer != null) { // Dispose timer oTimer.Dispose(); // Set to null oTimer = null; } }
public static void InitTimer( ref SimpleTimer oTimer, long lIntervalMs, SimpleTimerCallback pfCallback, bool bStartImmediately, string sName) { if (oTimer != null) { ExceptionUtil.RaiseInvalidOperationException( System.Reflection.MethodInfo.GetCurrentMethod(), "Can't start timer " + sName + ", already created"); } oTimer = new SimpleTimer( lIntervalMs, pfCallback, bStartImmediately, sName ); }