UiaControlsTest.WpfAppTests.NSetTextAndSelection C# (CSharp) Method

NSetTextAndSelection() private method

private NSetTextAndSelection ( string text, int selectionStart, int selectionLength ) : void
text string
selectionStart int
selectionLength int
return void
        private void NSetTextAndSelection(string text, int selectionStart, int selectionLength)
        {
            var cps = (ICaretPositionPattern)_nAdvancedTextBoxElement.GetCurrentPattern(CaretPositionPattern.Pattern.Id);
            var value = (IUIAutomationValuePattern)_nAdvancedTextBoxElement.GetCurrentPattern(ValuePattern.Pattern.Id);
            value.SetValue(text);
            cps.SetSelectionStart(selectionStart);
            cps.SetSelectionLength(selectionLength);
        }