Example #1
0
 /// <summary>
 /// Converts a native textrange array to an array of <see cref="TextRange" />
 /// </summary>
 public static TextRange[] NativeArrayToManaged(UIA3Automation automation, UIA.IUIAutomationTextRangeArray nativeElements)
 {
     if (nativeElements == null)
     {
         return new TextRange[0];
     }
     var retArray = new TextRange[nativeElements.Length];
     for (var i = 0; i < nativeElements.Length; i++)
     {
         retArray[i] = NativeToManaged(automation, nativeElements.GetElement(i));
     }
     return retArray;
 }
Example #2
0
        public static ITextRange[] NativeArrayToManaged(UIA3Automation automation, UIA.IUIAutomationTextRangeArray nativeTextRangeArray)
        {
            if (nativeTextRangeArray == null)
            {
                return(new ITextRange[0]);
            }
            var retArray = new ITextRange[nativeTextRangeArray.Length];

            for (var i = 0; i < nativeTextRangeArray.Length; i++)
            {
                retArray[i] = NativeToManaged(automation, nativeTextRangeArray.GetElement(i));
            }
            return(retArray);
        }