コード例 #1
0
        public static void UnregisterChordsConsumer(int index)
        {
            if ((0 <= index) && (index < Current.chordsConsumers.Count))
            {
                Shortcuts consumer = Current.chordsConsumers[index];

                UnregisterChordsConsumer(consumer);
            }
        }
コード例 #2
0
 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();
 }
コード例 #3
0
        public static void RegisterChordsConsumer(Shortcuts consumer)
        {
            if (Current.chordsConsumers.Count == 0)
            {
                ChordMessageFilter.RegisterInstance();
            }

            if (!Current.chordsConsumers.Contains(consumer))
            {
                Current.chordsConsumers.Add(consumer);
            }
        }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 public InputBindingsCollection(Shortcuts owner)
 {
     this.owner = owner;
 }