Atspi.Text.GetText C# (CSharp) Method

GetText() public method

public GetText ( ) : string
return string
        public string GetText()
        {
            return proxy.GetText (0, -1);
        }

Same methods

Text::GetText ( int startOffset, int endOffset ) : string

Usage Example

コード例 #1
0
        public ITextPatternRange FindText(string txt, bool backward, bool ignoreCase)
        {
            string           contents = text.GetText();
            StringComparison cmp      = ignoreCase ? StringComparison.CurrentCultureIgnoreCase
                                                          : StringComparison.CurrentCulture;

            if (String.IsNullOrEmpty(txt) || String.IsNullOrEmpty(contents))
            {
                return(null);
            }

            int index = -1;

            if (backward)
            {
                index = contents.LastIndexOf(txt, endOffset - 1,
                                             endOffset - startOffset, cmp);
            }
            else
            {
                index = contents.IndexOf(txt, startOffset,
                                         endOffset - startOffset, cmp);
            }

            return((index >= 0) ? new TextRangePattern(accessible,
                                                       index, index + txt.Length)
                                : null);
        }