示例#1
0
        /// <summary> Filter the list with the given filter.</summary>
        /// <param name="filter">The filter to use.
        /// </param>
        /// <param name="recursive">If <code>true<code> digs into the children recursively.
        /// </param>
        /// <returns> A new node array containing the nodes accepted by the filter.
        /// This is a linear list and preserves the nested structure of the returned
        /// nodes only.
        /// </returns>
        public virtual NodeList ExtractAllNodesThatMatch(INodeFilter filter, bool recursive)
        {
            INode    node;
            NodeList children;
            NodeList ret;

            ret = new NodeList();
            for (int i = 0; i < m_iSize; i++)
            {
                node = nodeData[i];
                if (filter.Accept(node))
                {
                    ret.Add(node);
                }
                if (recursive)
                {
                    children = node.Children;
                    if (null != children)
                    {
                        ret.Add(children.ExtractAllNodesThatMatch(filter, recursive));
                    }
                }
            }

            return(ret);
        }
示例#2
0
        /// <summary> Remove nodes not matching the given filter.</summary>
        /// <param name="filter">The filter to use.
        /// </param>
        /// <param name="recursive">If <code>true<code> digs into the children recursively.
        /// </param>
        public virtual void KeepAllNodesThatMatch(INodeFilter filter, bool recursive)
        {
            INode    node;
            NodeList children;

            for (int i = 0; i < m_iSize;)
            {
                node = nodeData[i];
                if (!filter.Accept(node))
                {
                    Remove(i);
                }
                else
                {
                    if (recursive)
                    {
                        children = node.Children;
                        if (null != children)
                        {
                            children.KeepAllNodesThatMatch(filter, recursive);
                        }
                    }
                    i++;
                }
            }
        }
示例#3
0
 /// <summary> Collect this node and its child nodes (if-applicable) into the collectionList parameter, provided the node
 /// satisfies the filtering criteria.<P>
 ///
 /// This mechanism allows powerful filtering code to be written very easily,
 /// without bothering about collection of embedded tags separately.
 /// e.g. when we try to get all the links on a page, it is not possible to
 /// get it at the top-level, as many tags (like form tags), can contain
 /// links embedded in them. We could get the links out by checking if the
 /// current node is a <see cref="CompositeTag"></see>, and going through its children.
 /// So this method provides a convenient way to do this.<P>
 ///
 /// Using collectInto(), programs get a lot shorter. Now, the code to
 /// extract all links from a page would look like:
 /// <pre>
 /// NodeList collectionList = new NodeList();
 /// NodeFilter filter = new TagNameFilter ("A");
 /// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
 /// e.nextNode().collectInto(collectionList, filter);
 /// </pre>
 /// Thus, collectionList will hold all the link nodes, irrespective of how
 /// deep the links are embedded.<P>
 ///
 /// Another way to accomplish the same objective is:
 /// <pre>
 /// NodeList collectionList = new NodeList();
 /// NodeFilter filter = new TagClassFilter (LinkTag.class);
 /// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
 /// e.nextNode().collectInto(collectionList, filter);
 /// </pre>
 /// This is slightly less specific because the LinkTag class may be
 /// registered for more than one node name, e.g. &lt;LINK&gt; tags too.
 /// </summary>
 /// <param name="list">The node list to collect acceptable nodes into.
 /// </param>
 /// <param name="filter">The filter to determine which nodes are retained.
 /// </param>
 public virtual void CollectInto(NodeList list, INodeFilter filter)
 {
     if (filter.Accept(this))
     {
         list.Add(this);
     }
 }
示例#4
0
        /// <summary> Creates an OrFilter that accepts nodes acceptable to either filter.</summary>
        /// <param name="left">One filter.
        /// </param>
        /// <param name="right">The other filter.
        /// </param>
        public OrFilter(INodeFilter left, INodeFilter right)
        {
            INodeFilter[] predicates;

            predicates    = new INodeFilter[2];
            predicates[0] = left;
            predicates[1] = right;
            Predicates    = predicates;
        }
		/// <summary> Creates an XorFilter that accepts nodes acceptable to either filter, but not both.</summary>
		/// <param name="left">One filter.
		/// </param>
		/// <param name="right">The other filter.
		/// </param>
		public XorFilter(INodeFilter left, INodeFilter right)
		{
			INodeFilter[] predicates;
			
			predicates = new INodeFilter[2];
			predicates[0] = left;
			predicates[1] = right;
			Predicates = predicates;
		}
示例#6
0
        private static void UpdateFilter(string filterIdentifer, INodeFilter newFilter)
        {
            //remove the current filter that exists
            App.nodeCollection.RemoveEventFilter(filterIdentifer);

            //add a new filter with our date restrictions
            App.nodeCollection.AddEventFilter(filterIdentifer, newFilter);

            //rebuild the timeline according to the new filters
            timelinePage.RebuildTimeline();
        }
示例#7
0
        /// <summary> Extract all nodes matching the given filter.</summary>
        /// <param name="filter">The filter to be applied to the nodes.
        /// </param>
        /// <throws>  ParserException If a parse error occurs. </throws>
        /// <returns> A list of nodes matching the filter criteria,
        /// i.e. for which the filter's accept method
        /// returned <code>true</code>.
        /// </returns>
        public virtual NodeList ExtractAllNodesThatMatch(INodeFilter filter)
        {
            INodeIterator e;
            NodeList      ret;

            ret = new NodeList();
            for (e = Elements(); e.HasMoreNodes();)
            {
                e.NextNode().CollectInto(ret, filter);
            }
            return(ret);
        }
示例#8
0
 /// <summary> Collect this node and its child nodes (if-applicable) into the list parameter,
 /// provided the node satisfies the filtering criteria.
 /// <p>This mechanism allows powerful filtering code to be written very easily,
 /// without bothering about collection of embedded tags separately.
 /// e.g. when we try to get all the links on a page, it is not possible to
 /// get it at the top-level, as many tags (like form tags), can contain
 /// links embedded in them. We could get the links out by checking if the
 /// current node is a {@link CompositeTag}, and going through its children.
 /// So this method provides a convenient way to do this.</p>
 /// <p>Using collectInto(), programs get a lot shorter. Now, the code to
 /// extract all links from a page would look like:
 /// <pre>
 /// NodeList list = new NodeList();
 /// NodeFilter filter = new TagNameFilter ("A");
 /// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
 /// e.nextNode().collectInto(list, filter);
 /// </pre>
 /// Thus, <code>list</code> will hold all the link nodes, irrespective of how
 /// deep the links are embedded.</p>
 /// <p>Another way to accomplish the same objective is:
 /// <pre>
 /// NodeList list = new NodeList();
 /// NodeFilter filter = new TagClassFilter (LinkTag.class);
 /// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
 /// e.nextNode().collectInto(list, filter);
 /// </pre>
 /// This is slightly less specific because the LinkTag class may be
 /// registered for more than one node name, e.g. &lt;LINK&gt; tags too.</p>
 /// </summary>
 /// <param name="list">The list to add nodes to.
 /// </param>
 /// <param name="filter">The filter to apply.
 /// </param>
 public override void CollectInto(NodeList list, INodeFilter filter)
 {
     base.CollectInto(list, filter);
     for (ISimpleNodeIterator e = GetChildren(); e.HasMoreNodes();)
     {
         e.NextNode().CollectInto(list, filter);
     }
     if ((null != GetEndTag()) && (this != GetEndTag()))
     {
         // 2nd guard handles <tag/>
         GetEndTag().CollectInto(list, filter);
     }
 }
示例#9
0
文件: SearchWindow.cs 项目: mo5h/omeo
        /// <summary>
        /// Creates a new search window for a tree view
        /// </summary>
        public SearchWindow()
        {
            if (Handle == (IntPtr)0)
            {
                HandleCreated += OnHandleCreated;
            }
            else
            {
                Size = DefaultSize;
            }

            BackColor = SystemColors.Info;
            ForeColor = SystemColors.InfoText;

            myNodeFilter = new StartingFilter();
            Visible      = false;
        }
示例#10
0
        /// <summary> Parse the given resource, using the filter provided.
        /// This can be used to extract information from specific nodes.
        /// When used with a <code>null</code> filter it returns an
        /// entire page which can then be modified and converted back to HTML
        /// (Note: the synthesis use-case is not handled very well; the parser
        /// is more often used to extract information from a web page).
        /// <p>For example, to replace the entire contents of the HEAD with a
        /// single TITLE tag you could do this:
        /// <pre>
        /// NodeList nl = parser.parse (null); // here is your two node list
        /// NodeList heads = nl.extractAllNodesThatMatch (new TagNameFilter ("HEAD"))
        /// if (heads.size () > 0) // there may not be a HEAD tag
        /// {
        /// Head head = heads.elementAt (0); // there should be only one
        /// head.removeAll (); // clean out the contents
        /// Tag title = new TitleTag ();
        /// title.setTagName ("title");
        /// title.setChildren (new NodeList (new TextNode ("The New Title")));
        /// Tag title_end = new TitleTag ();
        /// title_end.setTagName ("/title");
        /// title.setEndTag (title_end);
        /// head.add (title);
        /// }
        /// System.out.println (nl.toHtml ()); // output the modified HTML
        /// </pre>
        /// </p>
        /// </summary>
        /// <returns> The list of matching nodes (for a <code>null</code>
        /// filter this is all the top level nodes).
        /// </returns>
        /// <param name="filter">The filter to apply to the parsed nodes,
        /// or <code>null</code> to retrieve all the top level nodes.
        /// </param>
        /// <throws>  ParserException If a parsing error occurs. </throws>
        public virtual NodeList Parse(INodeFilter filter)
        {
            INodeIterator e;
            INode         node;
            NodeList      ret;

            ret = new NodeList();
            for (e = Elements(); e.HasMoreNodes();)
            {
                node = e.NextNode();
                if (null != filter)
                {
                    node.CollectInto(ret, filter);
                }
                else
                {
                    ret.Add(node);
                }
            }

            return(ret);
        }
示例#11
0
 /// <summary>
 /// Returns a new NodeIterator object.
 /// </summary>
 /// <param name="root">The root node at which to begin the NodeIterator's traversal.</param>
 /// <param name="whatToShow">Bitwise OR'd list of Filter specification constants from the NodeFilter DOM interface, indicating which nodes to iterate over.</param>
 /// <param name="filter">An object implementing the NodeFilter interface; its acceptNode() method will be called for each node in the subtree based at root which is accepted as included by the whatToShow flag to determine whether or not to include it in the list of iterable nodes (a simple callback function may also be used instead). The method should return one of NodeFilter.FILTER_ACCEPT, NodeFilter.FILTER_REJECT, or NodeFilter.FILTER_SKIP.</param>
 /// <returns></returns>
 public virtual extern NodeIterator CreateNodeIterator(Node root, NodeFilter whatToShow, INodeFilter filter);
		/// <summary> Creates a new instance of HasChildFilter that accepts nodes
		/// with a child acceptable to the filter.
		/// Of necessity, this applies only to composite tags, i.e. those that can
		/// contain other nodes, for example &lt;HTML&gt;&lt;/HTML&gt;.
		/// </summary>
		/// <param name="filter">The filter to apply to children.
		/// </param>
		/// <param name="recursive">If <code>true</code>, any enclosed node acceptable
		/// to the given filter causes the node being tested to be accepted
		/// (i.e. a recursive scan through the child nodes down the node
		/// heirarchy is performed).
		/// </param>
		public HasChildFilter(INodeFilter filter, bool recursive)
		{
			ChildFilter = filter;
			Recursive = recursive;
		}
		/// <summary> Collect this node and its child nodes (if-applicable) into the list parameter,
		/// provided the node satisfies the filtering criteria.
		/// <p>This mechanism allows powerful filtering code to be written very easily,
		/// without bothering about collection of embedded tags separately.
		/// e.g. when we try to get all the links on a page, it is not possible to
		/// get it at the top-level, as many tags (like form tags), can contain
		/// links embedded in them. We could get the links out by checking if the
		/// current node is a {@link CompositeTag}, and going through its children.
		/// So this method provides a convenient way to do this.</p>
		/// <p>Using collectInto(), programs get a lot shorter. Now, the code to
		/// extract all links from a page would look like:
		/// <pre>
		/// NodeList list = new NodeList();
		/// NodeFilter filter = new TagNameFilter ("A");
		/// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
		/// e.nextNode().collectInto(list, filter);
		/// </pre>
		/// Thus, <code>list</code> will hold all the link nodes, irrespective of how
		/// deep the links are embedded.</p>
		/// <p>Another way to accomplish the same objective is:
		/// <pre>
		/// NodeList list = new NodeList();
		/// NodeFilter filter = new TagClassFilter (LinkTag.class);
		/// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
		/// e.nextNode().collectInto(list, filter);
		/// </pre>
		/// This is slightly less specific because the LinkTag class may be
		/// registered for more than one node name, e.g. &lt;LINK&gt; tags too.</p>
		/// </summary>
		/// <param name="list">The list to add nodes to.
		/// </param>
		/// <param name="filter">The filter to apply.
		/// </param>
		public override void CollectInto(NodeList list, INodeFilter filter)
		{
			base.CollectInto(list, filter);
			for (ISimpleNodeIterator e = GetChildren(); e.HasMoreNodes(); )
				e.NextNode().CollectInto(list, filter);
			if ((null != GetEndTag()) && (this != GetEndTag()))
				// 2nd guard handles <tag/>
				GetEndTag().CollectInto(list, filter);
		}
		/// <summary> Creates a new instance of HasParentFilter that accepts nodes with
		/// the direct parent acceptable to the filter.
		/// </summary>
		/// <param name="filter">The filter to apply to the parent.
		/// </param>
		public HasParentFilter(INodeFilter filter):this(filter, false)
		{
		}
示例#15
0
 /// <summary>
 /// The Document.createTreeWalker() creator method returns a newly created TreeWalker object.
 /// </summary>
 /// <param name="root">Is the root Node of this TreeWalker traversal. Typically this will be an element owned by the document.</param>
 /// <param name="whatToShow">Is an optionale unsigned long representing a bitmask created by combining the constant properties of NodeFilter. It is a convenient way of filtering for certain types of node. It defaults to 0xFFFFFFFF representing the SHOW_ALL constant.</param>
 /// <param name="filter">Is an optional NodeFilter, that is an object with a method acceptNode, which is called by the TreeWalker to determine whether or not to accept a node that has passed the whatToShow check.</param>
 /// <returns></returns>
 public virtual TreeWalker CreateTreeWalker(Node root, NodeFilter whatToShow, INodeFilter filter)
 {
     return(null);
 }
		/// <summary> Creates a new instance of HasParentFilter that accepts nodes with
		/// a parent acceptable to the filter.
		/// </summary>
		/// <param name="filter">The filter to apply to the parent.
		/// </param>
		/// <param name="recursive">If <code>true</code>, any enclosing node acceptable
		/// to the given filter causes the node being tested to be accepted
		/// (i.e. a recursive scan through the parent nodes up the node
		/// heirarchy is performed).
		/// </param>
		public HasParentFilter(INodeFilter filter, bool recursive)
		{
			ParentFilter = filter;
			Recursive = recursive;
		}
示例#17
0
 public static TreeWalker CreateTreeWalker(XmlNode root, NodeFilter whatToShow, INodeFilter filter)
 {
     return(default(TreeWalker));
 }
		/// <summary> Creates a new instance of HasChildFilter that accepts nodes
		/// with a direct child acceptable to the filter.
		/// </summary>
		/// <param name="filter">The filter to apply to the children.
		/// </param>
		public HasChildFilter(INodeFilter filter):this(filter, false)
		{
		}
示例#19
0
 /// <summary> Filter the list with the given filter non-recursively.</summary>
 /// <param name="filter">The filter to use.
 /// </param>
 /// <returns> A new node array containing the nodes accepted by the filter.
 /// This is a linear list and preserves the nested structure of the returned
 /// nodes only.
 /// </returns>
 public virtual NodeList ExtractAllNodesThatMatch(INodeFilter filter)
 {
     return(ExtractAllNodesThatMatch(filter, false));
 }
		/// <summary> Extract all nodes matching the given filter.</summary>
		/// <param name="filter">The filter to be applied to the nodes.
		/// </param>
		/// <throws>  ParserException If a parse error occurs. </throws>
		/// <returns> A list of nodes matching the filter criteria,
		/// i.e. for which the filter's accept method
		/// returned <code>true</code>.
		/// </returns>
		public virtual NodeList ExtractAllNodesThatMatch(INodeFilter filter)
		{
			INodeIterator e;
			NodeList ret;
			
			ret = new NodeList();
			for (e = Elements(); e.HasMoreNodes(); )
				e.NextNode().CollectInto(ret, filter);			
			return (ret);
		}
		/// <summary> Parse the given resource, using the filter provided.
		/// This can be used to extract information from specific nodes.
		/// When used with a <code>null</code> filter it returns an
		/// entire page which can then be modified and converted back to HTML
		/// (Note: the synthesis use-case is not handled very well; the parser
		/// is more often used to extract information from a web page).
		/// <p>For example, to replace the entire contents of the HEAD with a
		/// single TITLE tag you could do this:
		/// <pre>
		/// NodeList nl = parser.parse (null); // here is your two node list
		/// NodeList heads = nl.extractAllNodesThatMatch (new TagNameFilter ("HEAD"))
		/// if (heads.size () > 0) // there may not be a HEAD tag
		/// {
		/// Head head = heads.elementAt (0); // there should be only one
		/// head.removeAll (); // clean out the contents
		/// Tag title = new TitleTag ();
		/// title.setTagName ("title");
		/// title.setChildren (new NodeList (new TextNode ("The New Title")));
		/// Tag title_end = new TitleTag ();
		/// title_end.setTagName ("/title");
		/// title.setEndTag (title_end);
		/// head.add (title);
		/// }
		/// System.out.println (nl.toHtml ()); // output the modified HTML
		/// </pre>
		/// </p>
		/// </summary>
		/// <returns> The list of matching nodes (for a <code>null</code>
		/// filter this is all the top level nodes).
		/// </returns>
		/// <param name="filter">The filter to apply to the parsed nodes,
		/// or <code>null</code> to retrieve all the top level nodes.
		/// </param>
		/// <throws>  ParserException If a parsing error occurs. </throws>
		public virtual NodeList Parse(INodeFilter filter)
		{
			INodeIterator e;
			INode node;
			NodeList ret;
			
			ret = new NodeList();
			for (e = Elements(); e.HasMoreNodes(); )
			{
				node = e.NextNode();
				if (null != filter)
					node.CollectInto(ret, filter);
				else
					ret.Add(node);
			}
			
			return (ret);
		}
 /// <summary> Creates a new instance of HasSiblingFilter that accepts nodes
 /// with sibling acceptable to the filter.
 /// </summary>
 /// <param name="filter">The filter to apply to the sibling.
 /// </param>
 public HasSiblingFilter(INodeFilter filter)
 {
     SiblingFilter = filter;
 }
		/// <summary> Creates an XorFilter that accepts nodes acceptable an odd number of the given filters.</summary>
		/// <param name="predicates">The list of filters. 
		/// </param>
		public XorFilter(INodeFilter[] predicates)
		{
			Predicates = predicates;
		}
示例#24
0
 /// <summary>
 /// The Document.createTreeWalker() creator method returns a newly created TreeWalker object.
 /// </summary>
 /// <param name="root">Is the root Node of this TreeWalker traversal. Typically this will be an element owned by the document.</param>
 /// <param name="whatToShow">Is an optionale unsigned long representing a bitmask created by combining the constant properties of NodeFilter. It is a convenient way of filtering for certain types of node. It defaults to 0xFFFFFFFF representing the SHOW_ALL constant.</param>
 /// <param name="filter">Is an optional NodeFilter, that is an object with a method acceptNode, which is called by the TreeWalker to determine whether or not to accept a node that has passed the whatToShow check.</param>
 /// <returns></returns>
 public virtual extern TreeWalker CreateTreeWalker(Node root, NodeFilter whatToShow, INodeFilter filter);
示例#25
0
 public static NodeIterator CreateNodeIterator(XmlNode root, NodeFilter whatToShow, INodeFilter filter)
 {
     return(default(NodeIterator));
 }
示例#26
0
 /// <summary> Remove nodes not matching the given filter non-recursively.</summary>
 /// <param name="filter">The filter to use.
 /// </param>
 public virtual void KeepAllNodesThatMatch(INodeFilter filter)
 {
     KeepAllNodesThatMatch(filter, false);
 }
示例#27
0
 public static NodeIterator CreateNodeIterator(XmlNode root, NodeFilter whatToShow, INodeFilter filter)
 {
     return default(NodeIterator);
 }
 /// <summary> Creates a new instance of HasChildFilter that accepts nodes
 /// with a direct child acceptable to the filter.
 /// </summary>
 /// <param name="filter">The filter to apply to the children.
 /// </param>
 public HasChildFilter(INodeFilter filter) : this(filter, false)
 {
 }
示例#29
0
 /// <summary>
 /// Returns a new NodeIterator object.
 /// </summary>
 /// <param name="root">The root node at which to begin the NodeIterator's traversal.</param>
 /// <param name="whatToShow">Bitwise OR'd list of Filter specification constants from the NodeFilter DOM interface, indicating which nodes to iterate over.</param>
 /// <param name="filter">An object implementing the NodeFilter interface; its acceptNode() method will be called for each node in the subtree based at root which is accepted as included by the whatToShow flag to determine whether or not to include it in the list of iterable nodes (a simple callback function may also be used instead). The method should return one of NodeFilter.FILTER_ACCEPT, NodeFilter.FILTER_REJECT, or NodeFilter.FILTER_SKIP.</param>
 /// <returns></returns>
 public virtual NodeIterator CreateNodeIterator(Node root, NodeFilter whatToShow, INodeFilter filter)
 {
     return(null);
 }
示例#30
0
 /// <summary> Creates a new instance of HasParentFilter that accepts nodes with
 /// a parent acceptable to the filter.
 /// </summary>
 /// <param name="filter">The filter to apply to the parent.
 /// </param>
 /// <param name="recursive">If <code>true</code>, any enclosing node acceptable
 /// to the given filter causes the node being tested to be accepted
 /// (i.e. a recursive scan through the parent nodes up the node
 /// heirarchy is performed).
 /// </param>
 public HasParentFilter(INodeFilter filter, bool recursive)
 {
     ParentFilter = filter;
     Recursive    = recursive;
 }
		/// <summary> Creates a NotFilter that accepts nodes not acceptable to the predicate.</summary>
		/// <param name="predicate">The filter to consult.
		/// </param>
		public NotFilter(INodeFilter predicate)
		{
			Predicate = predicate;
		}
		/// <summary> Collect this node and its child nodes (if-applicable) into the collectionList parameter, provided the node
		/// satisfies the filtering criteria.<P>
		/// 
		/// This mechanism allows powerful filtering code to be written very easily,
		/// without bothering about collection of embedded tags separately.
		/// e.g. when we try to get all the links on a page, it is not possible to
		/// get it at the top-level, as many tags (like form tags), can contain
		/// links embedded in them. We could get the links out by checking if the
		/// current node is a <see cref="CompositeTag"></see>, and going through its children.
		/// So this method provides a convenient way to do this.<P>
		/// 
		/// Using collectInto(), programs get a lot shorter. Now, the code to
		/// extract all links from a page would look like:
		/// <pre>
		/// NodeList collectionList = new NodeList();
		/// NodeFilter filter = new TagNameFilter ("A");
		/// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
		/// e.nextNode().collectInto(collectionList, filter);
		/// </pre>
		/// Thus, collectionList will hold all the link nodes, irrespective of how
		/// deep the links are embedded.<P>
		/// 
		/// Another way to accomplish the same objective is:
		/// <pre>
		/// NodeList collectionList = new NodeList();
		/// NodeFilter filter = new TagClassFilter (LinkTag.class);
		/// for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
		/// e.nextNode().collectInto(collectionList, filter);
		/// </pre>
		/// This is slightly less specific because the LinkTag class may be
		/// registered for more than one node name, e.g. &lt;LINK&gt; tags too.
		/// </summary>
		/// <param name="list">The node list to collect acceptable nodes into.
		/// </param>
		/// <param name="filter">The filter to determine which nodes are retained.
		/// </param>
		public virtual void CollectInto(NodeList list, INodeFilter filter)
		{
			if (filter.Accept(this))
			{
				list.Add(this);
			}
		}
 private IList<INode> ParseFilterIntoNodeList(INodeFilter nodefilter)
 {
     return m_parser.Parse(nodefilter).ToNodeArray();
 }
示例#34
0
 /// <summary> Creates a new instance of HasParentFilter that accepts nodes with
 /// the direct parent acceptable to the filter.
 /// </summary>
 /// <param name="filter">The filter to apply to the parent.
 /// </param>
 public HasParentFilter(INodeFilter filter) : this(filter, false)
 {
 }
示例#35
0
 /// <summary> Creates a NotFilter that accepts nodes not acceptable to the predicate.</summary>
 /// <param name="predicate">The filter to consult.
 /// </param>
 public NotFilter(INodeFilter predicate)
 {
     Predicate = predicate;
 }
示例#36
0
 private IList <INode> ParseFilterIntoNodeList(INodeFilter nodefilter)
 {
     return(m_parser.Parse(nodefilter).ToNodeArray());
 }
示例#37
0
 public static TreeWalker CreateTreeWalker(XmlNode root, NodeFilter whatToShow, INodeFilter filter)
 {
     return default(TreeWalker);
 }
示例#38
0
        /// <summary>
        ///  applies a filter to the nodeList
        /// recalculates the <see cref="nodeList"/> upon adding a filter
        /// </summary>
        /// <param name="identifier">A unique identifer that will be used to identify the filtering instance</param>
        /// <param name="filter">a filter that will be applied to remove nodes from a collection. </param>

        public void AddEventFilter(string identifier, INodeFilter filter)
        {
            filterList.Add(identifier, filter);
            filter.Apply(ref nodeList);
        }
 /// <summary> Creates a new instance of HasChildFilter that accepts nodes
 /// with a child acceptable to the filter.
 /// Of necessity, this applies only to composite tags, i.e. those that can
 /// contain other nodes, for example &lt;HTML&gt;&lt;/HTML&gt;.
 /// </summary>
 /// <param name="filter">The filter to apply to children.
 /// </param>
 /// <param name="recursive">If <code>true</code>, any enclosed node acceptable
 /// to the given filter causes the node being tested to be accepted
 /// (i.e. a recursive scan through the child nodes down the node
 /// heirarchy is performed).
 /// </param>
 public HasChildFilter(INodeFilter filter, bool recursive)
 {
     ChildFilter = filter;
     Recursive   = recursive;
 }
		/// <summary> Creates a new instance of HasSiblingFilter that accepts nodes
		/// with sibling acceptable to the filter.
		/// </summary>
		/// <param name="filter">The filter to apply to the sibling.
		/// </param>
		public HasSiblingFilter(INodeFilter filter)
		{
			SiblingFilter = filter;
		}