Applitools.CodedUI.EyesKeyboard.Attach C# (CSharp) Метод

Attach() публичный статический Метод

public static Attach ( Logger logger, Applitools.CodedUI.Eyes eyes ) : void
logger Logger
eyes Applitools.CodedUI.Eyes
Результат void
        public static void Attach(Logger logger, Eyes eyes)
        {
            Keyboard.Instance = new EyesKeyboard(logger, eyes);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Starts a test.
        /// </summary>
        /// <param name="mainWindow">The main top-level window of the AUT.</param>
        /// <param name="appName">The name of the application under test.</param>
        /// <param name="testName">The test name.</param>
        /// <param name="viewportSize">The required application's client area viewport size
        /// or <c>Size.Empty</c> to allow any viewport size.</param>
        public void Open(
            UITestControl mainWindow,
            string appName,
            string testName,
            Size viewportSize)
        {
            ArgumentGuard.NotNull(mainWindow, nameof(mainWindow));

            if (0 == SafeNativeMethods.GetWindowThreadProcessId(mainWindow.WindowHandle, out uint pid))
            {
                var message = "Failed to obtain the process underlying window '{0}'"
                              .Fmt(mainWindow.WindowHandle);
                Logger.Log("Open(): {0}", message);
                throw new EyesException(message);
            }

            OpenBase((int)pid, appName, testName, viewportSize);

            EyesMouse.Attach(Logger, this);
            EyesKeyboard.Attach(Logger, this);
        }