public static void UnregisterChordsConsumer(int index) { if ((0 <= index) && (index < Current.chordsConsumers.Count)) { Shortcuts consumer = Current.chordsConsumers[index]; UnregisterChordsConsumer(consumer); } }
public static void UnregisterChordsConsumer(Shortcuts consumer) { if (ChordMessageFilter.Current.chordsConsumers.Contains(consumer)) { ChordMessageFilter.Current.chordsConsumers.Remove(consumer); } if (ChordMessageFilter.Current.chordsConsumers.Count != 0) { return; } ChordMessageFilter.UnregisterInstance(); }
public static void RegisterChordsConsumer(Shortcuts consumer) { if (Current.chordsConsumers.Count == 0) { ChordMessageFilter.RegisterInstance(); } if (!Current.chordsConsumers.Contains(consumer)) { Current.chordsConsumers.Add(consumer); } }
public static bool UnregisterInstance(Shortcuts consumer) { try { if (!ChordMessageFilter.registeredFilters.Contains(ChordMessageFilter.filterInstances[Thread.CurrentThread.ManagedThreadId])) { return(false); } ChordMessageFilter.registeredFilters.Remove(ChordMessageFilter.filterInstances[Thread.CurrentThread.ManagedThreadId]); Application.RemoveMessageFilter((IMessageFilter)ChordMessageFilter.filterInstances[Thread.CurrentThread.ManagedThreadId]); return(true); } catch (Exception ex) { throw new ApplicationException("Error while unregistering ChordMessageFilter instance", ex); } }
public static bool UnregisterInstance(Shortcuts consumer) { try { if (registeredFilters.Contains(filterInstance)) { registeredFilters.Remove(filterInstance); Application.RemoveMessageFilter(filterInstance); return(true); } return(false); } catch (Exception ex) { throw new ApplicationException("Error while unregistering ChordMessageFilter instance", ex); } }
public InputBindingsCollection(Shortcuts owner) { this.owner = owner; }