Exemple #1
0
        /// <summary>
        /// Select the first row by text in the given column.
        /// </summary>
        public DataGridRow Select(int columnIndex, string textToFind)
        {
            var gridRow = this.GetRowByValue(columnIndex, textToFind);

            if (WindowsVersion.IsWindows7())
            {
                gridRow.Cells[0].Click();
            }
            else
            {
                gridRow.Select();
            }

            return(gridRow);
        }
Exemple #2
0
        public void Close()
        {
            this.WaitUntilResponsive();
            if (!WindowsVersion.IsWindows7())
            {
                var closeButton = this.TitleBar?.CloseButton;
                if (closeButton != null)
                {
                    closeButton.Invoke();
                    return;
                }
            }

            this.AutomationElement.WindowPattern().Close();
        }
Exemple #3
0
        /// <summary>
        /// Select a row by index.
        /// </summary>
        public DataGridRow Select(int rowIndex)
        {
            var gridRow = this.GetRowByIndex(rowIndex);

            if (WindowsVersion.IsWindows7())
            {
                gridRow.Cells[0].Click();
            }
            else
            {
                gridRow.Select();
            }

            return(gridRow);
        }
Exemple #4
0
        public void Close()
        {
            this.WaitUntilResponsive();
            if (!WindowsVersion.IsWindows7())
            {
                var closeButton = this.TitleBar?.CloseButton;
                if (closeButton != null)
                {
                    closeButton.Invoke();
                    return;
                }
            }

            var windowPattern = this.Patterns.Window.PatternOrDefault;

            if (windowPattern != null)
            {
                windowPattern.Close();
                return;
            }

            throw new MethodNotSupportedException("Close is not supported");
        }