コード例 #1
0
ファイル: KeyboardController.cs プロジェクト: sillsdev/wesay
        /// <summary>
        /// Initializes the KeyboardController, blocks user input, and sets
        /// the focus on the specified control.
        /// </summary>
        /// <param name="control">The ControlTester to use the keyboard on.</param>
        public void UseOn(ControlTester control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            keyboardControl = new KeyboardControl(control);

            if (!restoreUserInput)
            {
                //if this next line returns false, I used to throw an exception...
                Win32.BlockInput(true);
                restoreUserInput = true;
            }
        }
コード例 #2
0
ファイル: KeyboardController.cs プロジェクト: minskowl/MY
        /// <summary>
        /// Initializes the KeyboardController, blocks user input, and sets
        /// the focus on the specified control.
        /// </summary>
        /// <param name="control">The ControlTester to use the keyboard on.</param>
        public void UseOn(ReflectionTester control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            Control c = control.TheObject as Control;

            FormsAssert.IsTrue(c != null, "Keyboard control requires tester of Control");
            sendKeys = sendKeysFactory.Create(c.Handle);

            keyboardControl = new KeyboardControl(control);

            if (!restoreUserInput)
            {
                //if this next line returns false, I used to throw an exception...
                User32.BlockInput(true);
                restoreUserInput = true;
            }
        }
コード例 #3
0
ファイル: KeyboardController.cs プロジェクト: bbriggs/wesay
		/// <summary>
		/// Initializes the KeyboardController, blocks user input, and sets
		/// the focus on the specified control.
		/// </summary>
		/// <param name="control">The ControlTester to use the keyboard on.</param>
		public void UseOn(ControlTester control)
		{
			if(control == null)
			{
				throw new ArgumentNullException("control");
			}

			keyboardControl = new KeyboardControl(control);

			if(!restoreUserInput)
			{
				//if this next line returns false, I used to throw an exception...
				Win32.BlockInput(true);
				restoreUserInput = true;
			}
		}