Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MouseSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
        /// </summary>
        /// <param name="inputSimulator">The <see cref="IInputSimulator"/> that owns this instance.</param>
        public MouseSimulator(IInputSimulator inputSimulator)
        {
            if (inputSimulator == null) throw new ArgumentNullException("inputSimulator");

            _inputSimulator = inputSimulator;
            _messageDispatcher = new WindowsInputMessageDispatcher();
        }
Example #2
0
        public KeyboardSimulator(IInputSimulator inputSimulator) {
            if (inputSimulator == null) {
                throw new ArgumentNullException(nameof(inputSimulator));
            }

            _inputSimulator = inputSimulator;
            _messageDispatcher = new WindowsInputMessageDispatcher();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="KeyboardSimulator"/> class using the specified <see cref="IInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
        /// </summary>
        /// <param name="messageDispatcher">The <see cref="IInputMessageDispatcher"/> to use for dispatching <see cref="INPUT"/> messages.</param>
        /// <exception cref="InvalidOperationException">If null is passed as the <paramref name="messageDispatcher"/>.</exception>
        public KeyboardSimulator(IInputMessageDispatcher messageDispatcher)
        {
            if (messageDispatcher == null)
                throw new InvalidOperationException(
                    string.Format("The {0} cannot operate with a null {1}. Please provide a valid {1} instance to use for dispatching {2} messages.",
                    typeof(KeyboardSimulator).Name, typeof(IInputMessageDispatcher).Name, typeof(INPUT).Name));

            _messageDispatcher = messageDispatcher;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MouseSimulator"/> class using the specified <see cref="IInputMessageDispatcher"/> for dispatching <see cref="InputEntry"/> messages.
        /// </summary>
        /// <param name="inputSimulator">The <see cref="IInputSimulator"/> that owns this instance.</param>
        /// <param name="messageDispatcher">The <see cref="IInputMessageDispatcher"/> to use for dispatching <see cref="InputEntry"/> messages.</param>
        /// <exception cref="InvalidOperationException">If null is passed as the <paramref name="messageDispatcher"/>.</exception>
        internal MouseSimulator(IInputSimulator inputSimulator, IInputMessageDispatcher messageDispatcher) {
            if (inputSimulator == null) throw new ArgumentNullException(nameof(inputSimulator));

            if (messageDispatcher == null)
                throw new InvalidOperationException(
                        string.Format("The {0} cannot operate with a null {1}. Please provide a valid {1} instance to use for dispatching {2} messages.",
                                typeof(MouseSimulator).Name, typeof(IInputMessageDispatcher).Name, typeof(InputEntry).Name));

            _inputSimulator = inputSimulator;
            _messageDispatcher = messageDispatcher;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MouseSimulator"/> class using the specified <see cref="IInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
        /// </summary>
        /// <param name="inputSimulator">The <see cref="IInputSimulator"/> that owns this instance.</param>
        /// <param name="messageDispatcher">The <see cref="IInputMessageDispatcher"/> to use for dispatching <see cref="INPUT"/> messages.</param>
        /// <exception cref="InvalidOperationException">If null is passed as the <paramref name="messageDispatcher"/>.</exception>
        internal MouseSimulator(IInputSimulator inputSimulator, IInputMessageDispatcher messageDispatcher)
        {
            if (inputSimulator == null)
            {
                throw new ArgumentNullException("inputSimulator");
            }

            if (messageDispatcher == null)
            {
                throw new InvalidOperationException(
                          string.Format("The {0} cannot operate with a null {1}. Please provide a valid {1} instance to use for dispatching {2} messages.",
                                        typeof(MouseSimulator).Name, typeof(IInputMessageDispatcher).Name, typeof(INPUT).Name));
            }

            _inputSimulator    = inputSimulator;
            _messageDispatcher = messageDispatcher;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
 /// </summary>
 public MouseSimulator()
 {
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
 /// </summary>
 /// <param name="inputSimulator">The <see cref="IInputSimulator"/> that owns this instance.</param>
 public MouseSimulator(IInputSimulator inputSimulator)
 {
     _inputSimulator    = inputSimulator ?? throw new ArgumentNullException("inputSimulator");
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyboardSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
 /// </summary>
 public KeyboardSimulator()
 {
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
 /// </summary>
 public MouseSimulator()
 {
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
 public KeyboardSimulator(IInputSimulator inputSimulator)
 {
     _inputSimulator    = inputSimulator ?? throw new ArgumentNullException(nameof(inputSimulator));
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyboardSimulator"/> class using the specified <see cref="IInputMessageDispatcher"/> for dispatching <see cref="Input"/> messages.
 /// </summary>
 /// <param name="messageDispatcher">The <see cref="IInputMessageDispatcher"/> to use for dispatching <see cref="Input"/> messages.</param>
 /// <exception cref="InvalidOperationException">If null is passed as the <paramref name="messageDispatcher"/>.</exception>
 internal KeyboardSimulator(IInputMessageDispatcher messageDispatcher)
 {
     this.messageDispatcher = messageDispatcher ?? throw new InvalidOperationException(
                                        string.Format("The {0} cannot operate with a null {1}. Please provide a valid {1} instance to use for dispatching {2} messages.",
                                                      typeof(KeyboardSimulator).Name, typeof(IInputMessageDispatcher).Name, typeof(Input).Name));
 }
Example #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyboardSimulator"/> class using an instance of a <see cref="WindowsInputMessageDispatcher"/> for dispatching <see cref="INPUT"/> messages.
 /// </summary>
 public KeyboardSimulator()
 {
     _messageDispatcher = new WindowsInputMessageDispatcher();
 }
 public WindowsInputMessageDispatcherTests()
 {
     this.inputMessageDispatcher = new WindowsInputMessageDispatcher();
 }