Example #1
0
 /// <summary>
 ///   stop the timer
 /// </summary>
 /// <param name = "MgData"> MgData</param>
 /// <param name = "seconds">interval in full seconds to invoke the function (from current time)</param>
 /// <param name = "isIdleTimer">true if this timer is the idle timer</param>
 internal void stopTimer(MGData mgData, int seconds, bool isIdleTimer)
 {
     if (seconds > 0)
     {
         //RCTimer/MgTimer works on milliseconds so convert seconds to milliseconds
         RCTimer.StopTimer(mgData, seconds * 1000, isIdleTimer);
     }
 }
Example #2
0
        /// <summary>
        ///   start a timer
        /// </summary>
        /// <param name = "mgd"> MgData </param>
        /// <param name = "seconds">interval in full seconds to invoke the function (from current time)</param>
        /// <param name = "isIdleTimer">true if this timer is the idle timer</param>
        internal void startTimer(MGData mgData, int seconds, bool isIdleTimer)
        {
            if (seconds > 0)
            {
                //RCTimer/MgTimer works on milliseconds so convert seconds to milliseconds
                RCTimer objRCTimer = new RCTimer(mgData, seconds * 1000, isIdleTimer);
                Commands.addAsync(CommandType.START_TIMER, objRCTimer);

                // fixed bug 284566, while we have command in he queue, execute them
                Commands.beginInvoke();
            }
        }
Example #3
0
        /// <summary>
        ///   Release references to mgData and to the task in order to let the gc to free the memory.
        ///   This code was moved from processClose in order to clean also when the "open window = NO" (non interactive tasks).
        /// </summary>
        /// <param name = "form"></param>
        internal void processDispose(GuiMgForm guiMgForm)
        {
            var    form = (MgForm)guiMgForm;
            var    task = (Task)form.getTask();
            MGData mgd  = task.getMGData();

            RCTimer.StopAll(mgd);

            if (mgd.IsAborting)
            {
                MGDataCollection.Instance.deleteMGDataTree(mgd.GetId());
            }
        }