Example #1
0
 /// <summary>
 /// Create delayed idle time action
 /// </summary>
 /// <param name="action">Action to execute on idle</param>
 /// <param name="delay">Minimum number of milliseconds to wait before executing the action</param>
 /// <param name="tag">Object that uniquely identifies the action. Typically creator object.</param>
 /// <param name="idleTime">Idle time service</param>
 public static void Create(Action action, int delay, object tag, IIdleTimeService idleTime)
 {
     if (!_idleActions.TryGetValue(tag, out IdleTimeAction existingAction))
     {
         existingAction    = new IdleTimeAction(action, delay, tag, idleTime);
         _idleActions[tag] = existingAction;
     }
 }
Example #2
0
        /// <summary>
        /// Create delayed idle time action
        /// </summary>
        /// <param name="action">Action to execute on idle</param>
        /// <param name="delay">Minimum number of milliseconds to wait before executing the action</param>
        /// <param name="tag">Object that uniquely identifies the action. Typically creator object.</param>
        /// <param name="shell"></param>
        public static void Create(Action action, int delay, object tag, ICoreShell shell)
        {
            IdleTimeAction existingAction;

            if (!_idleActions.TryGetValue(tag, out existingAction))
            {
                existingAction    = new IdleTimeAction(action, delay, tag, shell);
                _idleActions[tag] = existingAction;
            }
        }