internal static TextPatternRange[] Wrap(UIAutomationClient.IUIAutomationTextRangeArray ranges, TextPattern pattern) { if (ranges == null) { return(null); } TextPatternRange[] rangeArray = new TextPatternRange[ranges.Length]; for (int i = 0; i < ranges.Length; i++) { rangeArray[i] = new TextPatternRange(ranges.GetElement(i), pattern); } return(rangeArray); }
internal static TextPatternRange Wrap(UIAutomationClient.IUIAutomationTextRange range, TextPattern pattern) { Debug.Assert(pattern != null); if (range == null) { return(null); } else { return(new TextPatternRange(range, pattern)); } }