/// <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); } }
/// <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); } }