public void SkipChildren() { if (ChildIterator != null) { ChildIterator.SkipChildren(); } else { SkipChild = true; } }
public override void OnChildComplete(Behavior sender, NodeStatus status) { // we exit as soon as our child returns successfully. if (status == NodeStatus.SUCCESS) { Exit(status); // same as decorators. Because the selector is not posted, we have to exit ourselves. } // we move to the next child if the previous one failed or is aborted. else { // if we have more, we enters our next child. if (ChildIterator.MoveNext()) { ChildIterator.Current.Enter(); } // if we don't have any left, we exit with failure. else { Exit(status); } } }
public override void OnChildComplete(Behavior sender, NodeStatus status) { // if the child return with success, we proceed to the next. if (status == NodeStatus.SUCCESS) { // if we have more, we move on. if (ChildIterator.MoveNext()) { ChildIterator.Current.Enter(); } // otherwise, we say that we have successfully completed all sequence, and exit with success. else { Exit(status); } } // if it failed, or is aborted, we exit and propagate the code. else { Exit(status); } }
private ChildIterator (ChildIterator other, bool cloneFlag) : base (other, true) { }
public override XPathSequence Evaluate (XPathSequence iter) { XQueryContext ctx = iter.Context; if (iter.Position == 0) { iter = iter.Clone (); if (!iter.MoveNext ()) return new XPathEmptySequence (iter.Context); } XPathNavigator nav = iter.Current as XPathNavigator; if (nav == null) throw new XmlQueryException ("Node set is expected."); NodeIterator argIter = null; switch (Axis.AxisType) { case XPathAxisType.Child: argIter = new ChildIterator (nav, ctx); break; case XPathAxisType.Descendant: argIter = new DescendantIterator (nav, ctx); break; case XPathAxisType.Attribute: argIter = new AttributeIterator (nav, ctx); break; case XPathAxisType.Self: argIter = new SelfIterator (nav, ctx); break; case XPathAxisType.DescendantOrSelf: argIter = new DescendantOrSelfIterator (nav, ctx); break; case XPathAxisType.FollowingSibling: argIter = new FollowingSiblingIterator (nav, ctx); break; case XPathAxisType.Following: argIter = new FollowingIterator (nav, ctx); break; case XPathAxisType.Parent: argIter = new ParentIterator (nav, ctx); break; case XPathAxisType.Ancestor: argIter = new AncestorIterator (nav, ctx); break; case XPathAxisType.PrecedingSibling: argIter = new PrecedingSiblingIterator (nav, ctx); break; case XPathAxisType.Preceding: argIter = new PrecedingIterator (nav, ctx); break; case XPathAxisType.AncestorOrSelf: argIter = new AncestorOrSelfIterator (nav, ctx); break; case XPathAxisType.Namespace: // only applicable under XPath 2.0: not XQuery 1.0 argIter = new NamespaceIterator (nav, ctx); break; } return new AxisIterator (argIter, this); }