/// <summary> /// Returns a sequence of all first level children of the control. /// </summary> public override IEnumerable <ControlBase> GetChildren() { WaitForControlReadyIfNecessary(); ControlBase[] children = SourceControl.GetChildren() .Select(child => WrapUtil((CUITControls.HtmlControl)child)) .ToArray(); Dictionary <Type, int> tagInstancesByType = new Dictionary <Type, int>(); foreach (ControlBase child in children) { if (child.SourceControl.SearchProperties.Any()) { int tagInstances; if (tagInstancesByType.ContainsKey(child.GetType())) { tagInstances = tagInstancesByType[child.GetType()] += 1; } else { tagInstances = tagInstancesByType[child.GetType()] = 1; } child.SourceControl.FilterProperties.Add( CUITControls.HtmlControl.PropertyNames.TagInstance, tagInstances.ToString()); } yield return(child); } }
/// <summary> /// Returns a sequence of all first level children of the control. /// </summary> public override IEnumerable <ControlBase> GetChildren() { WaitForControlReady(); return(SourceControl.GetChildren() .Select(child => WrapUtil((CUITControls.HtmlControl)child)) .ToArray()); }
/// <summary> /// Returns a sequence of all first level children of the control. /// </summary> public override IEnumerable <ControlBase> GetChildren() { WaitForControlReadyIfNecessary(); var uicol = new List <ControlBase>(); foreach (UITestControl uitestcontrol in SourceControl.GetChildren()) { uicol.Add(WrapUtil((CUITControls.SilverlightControl)uitestcontrol)); } return(uicol); }
/// <summary> /// Returns a sequence of all first level children of the control. /// </summary> public override IEnumerable <ControlBase> GetChildren() { return(SourceControl.GetChildren().Select(ControlBaseFactory.Create)); }