System.Windows.Automation.TextPattern.GetVisibleRanges C# (CSharp) Method

GetVisibleRanges() public method

public GetVisibleRanges ( ) : System.Windows.Automation.Text.TextPatternRange[]
return System.Windows.Automation.Text.TextPatternRange[]
        public TextPatternRange[] GetVisibleRanges()
        {
            try
            {
                return TextPatternRange.Wrap(this._pattern.GetVisibleRanges(), this);
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }

Usage Example

Ejemplo n.º 1
0
        //---------------------------------------------------------------------------
        // Wrapper for TextPattern.GetVisibleRanges Method
        //---------------------------------------------------------------------------
        internal void Pattern_GetVisibleRanges(TextPattern textPattern, ref TextPatternRange[] returnedRanges, Type expectedException, CheckType checkType)
        {
            string call = "TextPattern.GetVisibleRanges()";
            Comment("---Calling " + call);

            try
            {
                returnedRanges = textPattern.GetVisibleRanges();
            }
            catch (Exception actualException)
            {
                if (Library.IsCriticalException(actualException))
                    throw;

                TestException(expectedException, actualException, call, checkType);
                return;
            }

            if (returnedRanges == null)
                ThrowMe(checkType, call + " should not give a null TextPatternRange");

            TestNoExceptionQuiet(expectedException, call, checkType);
        }