Example #1
0
 /// <summary>
 /// Disconnects command source from the command.
 /// </summary>
 /// <param name="commandSource">Reference to command source.</param>
 /// <param name="command">Reference to the command.</param>
 public static void UnRegisterCommandSource(ICommandSource commandSource, ICommand command)
 {
     if (commandSource == null)
         throw new NullReferenceException("commandSource cannot be null");
     if (command == null)
         throw new NullReferenceException("command cannot be null");
     if (_CommandBindings.Contains(command))
     {
         ArrayList subscribers = (ArrayList)_CommandBindings[command];
         if (subscribers.Contains(commandSource))
             subscribers.Remove(commandSource);
     }
     command.CommandSourceUnregistered(commandSource);
 }