Example #1
0
        public void ClearTimeOut(string name)
        {
            TimeOutCmd timeOut = GetTimeOut(name);

            if (timeOut != null)
            {
                timeOut.Dispose();
                _Timers.Remove(timeOut);
            }
        }
Example #2
0
        protected void SetTimeOut(TimeOutCmd timeOut)
        {
            string     name       = timeOut.Name;
            TimeOutCmd oldTimeOut = GetTimeOut(name);

            if (oldTimeOut != null)
            {
                // only allow replace of timeout if for same hsm.
                System.Diagnostics.Debug.Assert(oldTimeOut.Hsm == timeOut.Hsm);
                oldTimeOut.Dispose();
                _Timers.Remove(name);
            }

            _Timers.Add(name, timeOut);
        }
Example #3
0
        public void SetTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
        {
            TimeOutCmd timeOut = CreateTimeOut(name, at, hsm, ev, timeOutType);

            SetTimeOut(timeOut);
        }
Example #4
0
        public void SetTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
        {
            TimeOutCmd timeOut = CreateTimeOut(name, duration, hsm, ev, timeOutType);

            SetTimeOut(timeOut);
        }
        protected void SetTimeOut(TimeOutCmd timeOut)
        {
            string name = timeOut.Name;
            TimeOutCmd oldTimeOut = GetTimeOut (name);
            if (oldTimeOut != null)
            {
                // only allow replace of timeout if for same hsm.
                System.Diagnostics.Debug.Assert (oldTimeOut.Hsm == timeOut.Hsm);
                oldTimeOut.Dispose ();
                _Timers.Remove (name);
            }

            _Timers.Add (name, timeOut);
        }