Beispiel #1
0
        /// <summary>
        /// Creates a new InputBinding with the specified name, action and list of IInputMatcher instances, and adds it to the cache.
        /// </summary>
        /// <param name="name">Name of the InputBinding.</param>
        /// <param name="action">Delegate to execute if any of the bound IInputMatcher instances match.</param>
        /// <param name="inputMatchers">List of IInputMatcher instances to check for a match.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if the name parameter is null, empty or all whitespace, or if the action parameter is null.</exception>
        public void AddInputBinding(string name, InputBindingAction action, IEnumerable <IInputMatcher> inputMatchers)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException("name");
            }

            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            AddInputBinding(new InputBinding(name, action, inputMatchers));
        }
        /// <summary>
        /// Creates a new InputBinding instance with the specified name, action and list of IInputMatcher instances.
        /// </summary>
        /// <param name="name">Name of the InputBinding.</param>
        /// <param name="action">Delegate to execute if any of the bound IInputMatcher instances match.</param>
        /// <param name="inputMatchers">List of IInputMatcher instances to check for a match.</param>
        public InputBinding(string name, InputBindingAction action, IEnumerable <IInputMatcher> inputMatchers)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            if (inputMatchers == null)
            {
                throw new ArgumentNullException("inputMatchers");
            }

            Name          = name;
            Action        = action;
            Enabled       = true;
            MatchAll      = false;
            InputMatchers = new List <IInputMatcher>(inputMatchers);
        }
        /// <summary>
        /// Creates a new InputBinding instance with the specified name, action and list of IInputMatcher instances.
        /// </summary>
        /// <param name="name">Name of the InputBinding.</param>
        /// <param name="action">Delegate to execute if any of the bound IInputMatcher instances match.</param>
        /// <param name="inputMatchers">List of IInputMatcher instances to check for a match.</param>
        public InputBinding(string name, InputBindingAction action, IEnumerable<IInputMatcher> inputMatchers)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            if (inputMatchers == null)
            {
                throw new ArgumentNullException("inputMatchers");
            }

            Name = name;
            Action = action;
            Enabled = true;
            MatchAll = false;
            InputMatchers = new List<IInputMatcher>(inputMatchers);
        }
        /// <summary>
        /// Creates a new InputBinding with the specified name, action and list of IInputMatcher instances, and adds it to the cache.
        /// </summary>
        /// <param name="name">Name of the InputBinding.</param>
        /// <param name="action">Delegate to execute if any of the bound IInputMatcher instances match.</param>
        /// <param name="inputMatchers">List of IInputMatcher instances to check for a match.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if the name parameter is null, empty or all whitespace, or if the action parameter is null.</exception>
        public void AddInputBinding(string name, InputBindingAction action, IEnumerable<IInputMatcher> inputMatchers)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException("name");
            }

            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            AddInputBinding(new InputBinding(name, action, inputMatchers));
        }