Esempio n. 1
0
        public override bool isSupportedBy(ComponentPrx component, Ice.Current context__)
        {
            AutomationElement element = WGComponent.fromId(component.getId());

            return((bool)element.GetCurrentPropertyValue(
                       AutomationElement.IsExpandCollapsePatternAvailableProperty));
        }
Esempio n. 2
0
        public override void perform(ComponentPrx component, Ice.Current context__)
        {
            AutomationElement     element     = WGComponent.fromId(component.getId());
            ExpandCollapsePattern patternMenu =
                element.GetCurrentPattern(
                    ExpandCollapsePattern.Pattern) as ExpandCollapsePattern;

            // Pattern is not available for this component
            if (patternMenu == null)
            {
                // TODO: Log message
                return;
            }

            ExpandCollapseState state = patternMenu.Current.ExpandCollapseState;

            if (state == ExpandCollapseState.Expanded)
            {
                patternMenu.Collapse();
            }
            else if (state == ExpandCollapseState.PartiallyExpanded ||
                     state == ExpandCollapseState.Collapsed)
            {
                patternMenu.Expand();
            }
        }
Esempio n. 3
0
        public override void expandGUI(ComponentPrx component, Ice.Current context__)
        {
            ActionPrx[] eventList = component.getEventList();

            // Use the first event if one is available
            if (eventList.Length > 0)
            {
                eventList[0].perform(component);
            }
        }
Esempio n. 4
0
        public override void perform(ComponentPrx component, Ice.Current context__)
        {
            AutomationElement element = WGComponent.fromId(component.getId());

            if (isActable(element))
            {
                InvokePattern pattern =
                    element.GetCurrentPattern(InvokePattern.Pattern) as InvokePattern;
                pattern.Invoke();
            }
        }
Esempio n. 5
0
        public override ComponentPrx[] getChildren(Ice.Current context__)
        {
            AutomationElementCollection childrenList =
                element.FindAll(TreeScope.Children, Condition.TrueCondition);

            ComponentPrx[] components = new ComponentPrx[childrenList.Count];
            for (int i = 0; i < childrenList.Count; i++)
            {
                components[i] = new WGComponent(childrenList[i]).Proxy;
            }
            return(components);
        }
Esempio n. 6
0
        public WGComponent(AutomationElement element)
        {
            this.element = element;

            title        = element.Current.Name;
            boundingRect = element.Current.BoundingRectangle;

            /* Add this automation element to the cache */
            cache.Add(counter, element);
            id = counter;
            counter++;

            /* Add this component to the adapter */
            Ice.ObjectPrx base_ = Adapter.Instance.addWithUUID(this);
            proxy = ComponentPrxHelper.checkedCast(base_);
        }
Esempio n. 7
0
        public static ActionPrx[] getEventList(ComponentPrx component)
        {
            loadAssembly();

            // Check which events support the component
            List <ActionPrx> proxies = new List <ActionPrx>();

            foreach (ActionPrx action in actionList)
            {
                if (action.isSupportedBy(component))
                {
                    proxies.Add(action);
                }
            }
            return(proxies.ToArray());
        }
Esempio n. 8
0
 public override bool isExpandable(
     ComponentPrx component, WindowPrx window, Ice.Current context__)
 {
     return(component.getEventList().Length > 0);
 }