System.Windows.Automation.Text.TextPatternRange.GetText C# (CSharp) Метод

GetText() публичный Метод

public GetText ( int maxLength ) : string
maxLength int
Результат string
        public string GetText(int maxLength)
        {
            try
            {
                return this._range.GetText(maxLength);
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }

Usage Example

Пример #1
0
        public static int CountTrailingCRLF(AutomationElement autoElement, TextPatternRange callingRange)
        {
            // Bug: 1134056: Resolve RichEdit control inconsistencies / unexpected behavior
            int offset = 0;

            Library.ValidateArgumentNonNull(autoElement, "AutomationElement cannot be null");
            Library.ValidateArgumentNonNull(callingRange, "callingRange cannot be null");

            if (IsRichEdit(autoElement) == true)
            {
                string text = callingRange.GetText(-1);

                offset = GetTrailingCRLFOffset(text);
            }
            return offset;
        }
All Usage Examples Of System.Windows.Automation.Text.TextPatternRange::GetText