示例#1
0
 public Object filtering(String generatedNodeId, TreeScopeEnum treeScope)
 {
     if (generatedNodeId == null)
     {
         return(null);
     }
     return(filtering(treeOperation.searchNodes.getFilteredTreeOsmElementById(generatedNodeId), treeScope));
 }
示例#2
0
        /// <summary>
        /// filters an application depending on a given point (<paramref name="pointX"/>, <paramref name="pointY"/>) and the choosen <paramref name="treeScope"/>
        /// </summary>
        /// <param name="pointX">x coordinate of the element to filtering</param>
        /// <param name="pointY">y coordinate of the element to filtering</param>
        /// <param name="treeScope">kind of filtering</param>
        /// <param name="depth">depth of filtering for the <paramref name="treeScope"/> of 'Parent', 'Children' and 'Application';  <code>-1</code> means the whole depth</param>
        /// <returns>the filtered (sub-)tree</returns>
        public Object filtering(int pointX, int pointY, TreeScopeEnum treeScope, int depth = -1)
        {
            AutomationElement mainElement = deliverAutomationElementFromCursor(pointX, pointY);

            if (mainElement == null)
            {
                throw new ArgumentException("The AutomationElement is 'null'!");
            }
            Object tree = getStrategyMgr().getSpecifiedTree().NewTree();

            //    UIAEventsMonitor uiaEvents = new UIAEventsMonitor();
            //   uiaEvents.eventsUIA_withAutomationElement(mainElement);
            return(filtering(mainElement, treeScope, depth));
        }
示例#3
0
        /// <summary>
        /// filters an application depending on a given AutomationElement;
        /// only if the whole tree is filtered (TreeScopeEnum.Application) the ids for each node will be generated and set
        /// </summary>
        /// <param name="automationElement"> the AutomationElement of the filtered element</param>
        /// <param name="treeScope">kind of filtering</param>
        /// <param name="depth">depth of filtering for the <paramref name="treeScope"/> of 'Ancestors', 'Children' and 'Application';  <code>-1</code> means the whole depth</param>
        /// <returns>the filtered (sub-)tree</returns>
        private Object filtering(AutomationElement automationElement, TreeScopeEnum treeScope, int depth)
        {
            Object tree = getStrategyMgr().getSpecifiedTree().NewTree();

            if (automationElement == null)
            {
                throw new ArgumentException("The AutomationElement is 'null'!");
            }
            switch (treeScope)
            {
            case TreeScopeEnum.Sibling:
                filterSibling(automationElement, ref tree);
                break;

            case TreeScopeEnum.Children:
                filterChildren(automationElement, depth, ref tree);
                break;

            case TreeScopeEnum.Descendants:
                // same like as 'Children' but also all "child children"
                filterChildren(automationElement, -1, ref tree);
                break;

            case TreeScopeEnum.Subtree:
                filterSubtree(automationElement, ref tree);
                break;

            case TreeScopeEnum.Element:
                filterElement(automationElement, ref tree);
                setSpecialPropertiesOfFirstNode(ref tree);
                break;

            case TreeScopeEnum.Ancestors:
                // same like parents
                filterParents(automationElement, ref tree);
                break;

            case TreeScopeEnum.Application:
                filterApplication(automationElement, depth, ref tree);
                // note by the first node the filter strategy and ModulName
                setSpecialPropertiesOfFirstNode(ref tree);
                treeOperation.generatedIds.generatedIdsOfFilteredTree(ref tree);
                break;
            }
            return(tree);
        }
示例#4
0
        /// <summary>
        /// Filtered an OSM node (and depending on the <para>treescope</para> his sibilings, parents children etc. ) and updates the filtered tree object
        /// </summary>
        /// <param name="generatedId">the generated id of a node in the filtered tree</param>
        /// <param name="treescope">the scope for filtering</param>
        /// <param name="eventAction"></param>
        public void filterOSM(string generatedId, TreeScopeEnum treescope, String eventAction)
        {
            if (generatedId == null)
            {
                return;
            }
            switch (treescope)
            {
            case TreeScopeEnum.Ancestors:
                throw new NotImplementedException();
                break;

            case TreeScopeEnum.Sibling:
                throw new NotImplementedException();
                break;

            default:     //Application, Subtree, Children, Descendants, Element
                treeOperations.updateNodes.filteredTree(generatedId, treescope);
                break;
            }
        }
示例#5
0
        /// <summary>
        /// filters an application depending on a given OSM element
        /// </summary>
        /// <param name="osmElementOfFirstNodeOfSubtree">osm element of the to filtered application</param>
        /// <param name="treeScope">kind of filtering</param>
        /// <returns>the filtered (sub-)tree</returns>
        public Object filtering(OSMElements.OSMElement osmElementOfFirstNodeOfSubtree, TreeScopeEnum treeScope)
        {
            AutomationElement au = getAutomationelementOfOsmElement(osmElementOfFirstNodeOfSubtree);

            if (au != null)
            {
                return(filtering(au, treeScope, -1));
            }
            return(null);
        }
示例#6
0
        /// <summary>
        /// filters an application depending on a given hwnd
        /// </summary>
        /// <param name="hwnd">the process handle of applicatio/element</param>
        /// <param name="treeScope">kind of filtering</param>
        /// <param name="depth">depth of filtering for the <paramref name="treeScope"/> of 'Parent', 'Children' and 'Application';  <code>-1</code> means the whole depth</param>
        /// <returns>the filtered (sub-)tree</returns>
        public Object filtering(IntPtr hwnd, TreeScopeEnum treeScope = TreeScopeEnum.Application, int depth = -1)
        {
            AutomationElement mainElement = deliverAutomationElementFromHWND(hwnd);

            return(filtering(mainElement, treeScope, depth));
        }
示例#7
0
 public object filtering(string generatedNodeId, TreeScopeEnum treeScope)
 {
     throw new NotImplementedException();
 }
示例#8
0
 public Object filtering(OSMElements.OSMElement osmElementOfFirstNodeOfSubtree, TreeScopeEnum treeScopeEnum)
 {
     throw new NotImplementedException();
 }
示例#9
0
 public Object filtering(IntPtr hwnd, TreeScopeEnum treeScope, int depth)
 {
     throw new NotImplementedException();
 }
示例#10
0
 public Object filtering(int pointX, int pointY, TreeScopeEnum treeScope, int depth)
 {
     return(specifiedTree);
 }
示例#11
0
 /// <summary>
 /// Refreshs all Braille OSM elements depending on the given id of a node in the filtered tree; it wouldn't be filtered
 /// </summary>
 /// <param name="idGeneratedOfFilteredNode">a node id of the filtered tree; the connected (Braille) nodes will be refreshed</param>
 /// <param name="treescopeOfFilteredNode">the tree scope for updating based on the filtered tree</param>
 /// <param name="onlyActiveScreen"><c>true</c> if only the Braille nodes on the active scree shold be updated, otherwise all connected Braille nodes will be updated</param>
 public void refreshBrailleOSM(string idGeneratedOfFilteredNode, TreeScopeEnum treescopeOfFilteredNode, bool onlyActiveScreen = true)
 {
     treeOperations.updateNodes.refreshBrailleOSM(idGeneratedOfFilteredNode, treescopeOfFilteredNode, onlyActiveScreen);
 }