Exemplo n.º 1
0
        /// <summary>
        /// Specify which control or form we should use for the relative position.
        /// </summary>
        public void UseOn(ReflectionTester control)
        {
            if (mouseControl == null)
            {
                Win32.GetCursorPos(out originalPosition);
            }

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

            mouseControl = new MouseControl(control);

            PositionUnit = GraphicsUnit.Pixel;

            // Block any user input while we are active.
            if (!restoreUserInput)
            {
                if (!Win32.BlockInput(true))
                {
                    //throw new Win32Exception();
                }

                restoreUserInput = true;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Specify which control or form we should use for the relative position.
        /// </summary>
        public void UseOn(ReflectionTester control)
        {
            if(mouseControl == null)
            {
                Win32.GetCursorPos(out originalPosition);
            }

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

            mouseControl = new MouseControl(control);

            PositionUnit = GraphicsUnit.Pixel;

            // Block any user input while we are active.
            if(!restoreUserInput)
            {
                if(!Win32.BlockInput(true))
                {
                    //throw new Win32Exception();
                }

                restoreUserInput = true;
            }
        }