Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
        /// <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());
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a sequence of all first level children of the control.
 /// </summary>
 public override IEnumerable <ControlBase> GetChildren()
 {
     return(SourceControl.GetChildren().Select(ControlBaseFactory.Create));
 }