Ejemplo n.º 1
0
        private void FindAll(AutomationElement automationElement, InitializeOption option)
        {
            var finder = new AutomationElementFinder(automationElement);
            List <AutomationElement> children          = finder.Children(AutomationSearchCondition.All);
            ControlDictionary        controlDictionary = ControlDictionary.Instance;

            foreach (AutomationElement child in children)
            {
                if (!controlDictionary.IsControlTypeSupported(child.Current.ControlType))
                {
                    continue;
                }
                if (controlDictionary.IsPrimaryControl(child.Current.ControlType, child.Current.ClassName, null))
                {
                    list.Add(child);
                }
                if (!controlDictionary.HasPrimaryChildren(child.Current.ControlType))
                {
                    continue;
                }
                if (!controlDictionary.IsExcluded(child.Current.ControlType))
                {
                    FindAll(child, option);
                }
            }
        }
Ejemplo n.º 2
0
        private void AllSubsclassesHaveEmptyConstructor(BricksCollection<Class> collection, Type type)
        {
            var @class = new Class(type);
            Classes classes = @class.SubClassesInAssembly();
            foreach (Class subClass in classes)
            {
                bool hasDefaultConstructor = false;
                subClass.EachConstructor(delegate(ConstructorInfo constructorInfo)
                                             {
                                                 if (constructorInfo.GetParameters().Length == 0 || subClass.Name.Equals(typeof(ToggleableItem).Name))
                                                     hasDefaultConstructor = true;
                                             });
                if (!hasDefaultConstructor &&  subClass.ClassType.IsVisible && !subClass.Name.Equals("Desktop")) collection.Add(subClass);
            }

            Assert.AreEqual(0, collection.Count, collection.ToString());
        }
Ejemplo n.º 3
0
        private void AllSubsclassesHaveEmptyConstructor(BricksCollection <Class> collection, Type type)
        {
            var     @class  = new Class(type);
            Classes classes = @class.SubClassesInAssembly();

            foreach (Class subClass in classes)
            {
                bool hasDefaultConstructor = false;
                subClass.EachConstructor(delegate(ConstructorInfo constructorInfo)
                {
                    if (constructorInfo.GetParameters().Length == 0 || subClass.Name.Equals(typeof(ToggleableItem).Name))
                    {
                        hasDefaultConstructor = true;
                    }
                });
                if (!hasDefaultConstructor && subClass.ClassType.IsVisible && !subClass.Name.Equals("Desktop"))
                {
                    collection.Add(subClass);
                }
            }

            Assert.AreEqual(0, collection.Count, collection.ToString());
        }
Ejemplo n.º 4
0
 public virtual void Attach(Application application)
 {
     screenRepositories.Add(new ScreenRepository(application.ApplicationSession, sessionReport));
 }