System.Windows.Automation.TextPattern2.RangeFromAnnotation C# (CSharp) Method

RangeFromAnnotation() public method

public RangeFromAnnotation ( AutomationElement annotation ) : TextPatternRange
annotation AutomationElement
return System.Windows.Automation.Text.TextPatternRange
        public TextPatternRange RangeFromAnnotation(AutomationElement annotation)
        {
            Utility.ValidateArgumentNonNull(annotation, "annotation");
            try
            {
                return TextPatternRange.Wrap(this._pattern.RangeFromAnnotation(annotation.NativeElement), this);
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }