Esempio n. 1
0
        public override WidgetPrx[] getChildren(Ice.Current context__)
        {
            AutomationElementCollection childrenList =
            element.FindAll(TreeScope.Children, Condition.TrueCondition);

            WidgetPrx[] components = new WidgetPrx[childrenList.Count];
            for (int i = 0; i < childrenList.Count; i++)
            {
            components[i] = new WidgetI(process,childrenList[i],this).Proxy;
            }
            return components;
        }
Esempio n. 2
0
        public WidgetI(ProcessI process, AutomationElement element)
        {
            this.process = process;
            this.element = element;

            title = element.Current.Name;
            boundingRect = element.Current.BoundingRectangle;
            automationId = element.Current.AutomationId;
            controlType = element.Current.ControlType.ProgrammaticName;

            /* Add this component to the adapter */
            Ice.ObjectPrx base_ = process.register(this);
            proxy = WidgetPrxHelper.uncheckedCast(base_);
        }
Esempio n. 3
0
        public override WidgetPrx[] getWindows(Ice.Current current__)
        {
            // Check based on pid and for ControlType.Window
            PropertyCondition pidCondition = new PropertyCondition(
                AutomationElement.ProcessIdProperty, process.Id);
            PropertyCondition windowCondition = new PropertyCondition(
                AutomationElement.ControlTypeProperty, ControlType.Window);
            Condition condition = new AndCondition(pidCondition,
                                                   windowCondition);

            // Check the children of the automation root for windows
            AutomationElement root = AutomationElement.RootElement;
            AutomationElementCollection rootWindows =
                root.FindAll(TreeScope.Children, condition);

            // Register the windows
            WidgetPrx[] windows = new WidgetPrx[rootWindows.Count];
            for (int i = 0; i < rootWindows.Count; i++)
            {
                windows[i] = new WidgetI(this, rootWindows[i]).Proxy;
            }

            return windows;
        }