Example #1
0
        public AutomationElementCollection FindAll(TreeScope scope, Condition condition)
        {
            Utility.ValidateArgumentNonNull(condition, "condition");

            try
            {
                UIAutomationClient.IUIAutomationElementArray elemArray =
                    this._obj.FindAllBuildCache(
                        (UIAutomationClient.TreeScope)scope,
                        condition.NativeCondition,
                        CacheRequest.CurrentNativeCacheRequest);
                return(AutomationElementCollection.Wrap(elemArray));
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx))
                {
                    throw newEx;
                }
                else
                {
                    throw;
                }
            }
        }
Example #2
0
 internal static AutomationElement[] ConvertToElementArray(UIAutomationClient.IUIAutomationElementArray array)
 {
     AutomationElement[] elementArray;
     if (array != null)
     {
         elementArray = new AutomationElement[array.Length];
         for (int i = 0; i < array.Length; i++)
         {
             elementArray[i] = AutomationElement.Wrap(array.GetElement(i));
         }
     }
     else
     {
         elementArray = null;
     }
     return(elementArray);
 }
Example #3
0
 internal static AutomationElementCollection Wrap(UIAutomationClient.IUIAutomationElementArray obj)
 {
     return((obj == null) ? null : new AutomationElementCollection(obj));
 }
Example #4
0
 internal AutomationElementCollection(UIAutomationClient.IUIAutomationElementArray obj)
 {
     Debug.Assert(obj != null);
     this._obj = obj;
 }
Example #5
0
 internal AutomationElementCollectionEnumerator(UIAutomationClient.IUIAutomationElementArray obj)
 {
     Debug.Assert(obj != null);
     this._obj   = obj;
     this._cElem = obj.Length;
 }
 internal AutomationElementCollectionEnumerator(UIAutomationClient.IUIAutomationElementArray obj)
 {
     Debug.Assert(obj != null);
     this._obj = obj;
     this._cElem = obj.Length;
 }
 internal AutomationElementCollection(UIAutomationClient.IUIAutomationElementArray obj)
 {
     Debug.Assert(obj != null);
     this._obj = obj;
 }