예제 #1
0
 /// <summary>
 ///     Unregister the trigger
 /// </summary>
 /// <param name="trigger">The trigger</param>
 public void UnregisterTrigger <T, TKey>(BaseSterlingTrigger <T, TKey> trigger) where T : class, new()
 {
     using (LockAsync().Result)
     {
         _triggers[typeof(T)].Remove(trigger);
     }
 }
예제 #2
0
        /// <summary>
        ///     Register a trigger
        /// </summary>
        /// <param name="trigger">The trigger</param>
        public void RegisterTrigger <T, TKey>(BaseSterlingTrigger <T, TKey> trigger) where T : class, new()
        {
            using (LockAsync().Result)
            {
                if (!_triggers.ContainsKey(typeof(T)))
                {
                    _triggers.Add(typeof(T), new List <ISterlingTrigger>());
                }

                _triggers[typeof(T)].Add(trigger);
            }
        }