コード例 #1
0
        public static void DisposeTimer(
            ref SimpleTimer oTimer)
        {
            if (oTimer != null)
            {
                // Dispose timer
                oTimer.Dispose();

                // Set to null
                oTimer = null;
            }
        }
コード例 #2
0
        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
                );
        }