示例#1
0
        /// <summary>
        /// Removes the command binding.
        /// </summary>
        /// <param name="commandBinding">The command binding.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="commandBinding"/> is <c>null</c>.</exception>
        public void RemoveCommandBinding(CommandBinding commandBinding)
        {
            Argument.IsNotNull("commandBinding", commandBinding);

            Log.Debug("Removing command binding '{0}'", commandBinding);

            for (int i = 0; i < _commandBindings.Count; i++)
            {
                if (ReferenceEquals(_commandBindings[i], commandBinding))
                {
                    _commandBindings.RemoveAt(i);
                    return;
                }
            }
        }
示例#2
0
        /// <summary>
        /// Adds a new command binding.
        /// </summary>
        /// <param name="commandBinding">The command binding.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="commandBinding"/> is <c>null</c>.</exception>
        public void AddCommandBinding(CommandBinding commandBinding)
        {
            Argument.IsNotNull("commandBinding", commandBinding);

            Log.Debug("Adding command binding '{0}'", commandBinding);

            _commandBindings.Add(commandBinding);
        }