Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / followingquery.cs / 1 / followingquery.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System;
using System.Xml;
using System.Xml.XPath;
using System.Diagnostics;
internal sealed class FollowingQuery : BaseAxisQuery {
private XPathNavigator input;
private XPathNodeIterator iterator;
public FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) {}
private FollowingQuery(FollowingQuery other) : base(other) {
this.input = Clone(other.input);
this.iterator = Clone(other.iterator);
}
public override void Reset() {
iterator = null;
base.Reset();
}
public override XPathNavigator Advance() {
if (iterator == null) {
input = qyInput.Advance();
if (input == null) {
return null;
}
XPathNavigator prev;
do {
prev = input.Clone();
input = qyInput.Advance();
} while (prev.IsDescendant(input));
input = prev;
iterator = XPathEmptyIterator.Instance;
}
while (! iterator.MoveNext()) {
bool matchSelf;
if (input.NodeType == XPathNodeType.Attribute || input.NodeType == XPathNodeType.Namespace) {
input.MoveToParent();
matchSelf = false;
} else {
while (! input.MoveToNext()) {
if (! input.MoveToParent()) {
return null;
}
}
matchSelf = true;
}
if (NameTest) {
iterator = input.SelectDescendants(Name, Namespace, matchSelf);
} else {
iterator = input.SelectDescendants(TypeTest, matchSelf);
}
}
position++;
currentNode = iterator.Current;
return currentNode;
}
public override XPathNodeIterator Clone() { return new FollowingQuery(this); }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodePageUtils.cs
- TreeViewItem.cs
- DataGridViewColumnHeaderCell.cs
- SystemDropShadowChrome.cs
- TreeViewEvent.cs
- DesignerVerb.cs
- DataSet.cs
- DataRowChangeEvent.cs
- SecurityContext.cs
- SymmetricSecurityBindingElement.cs
- MasterPageCodeDomTreeGenerator.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- QilXmlReader.cs
- XpsResourceDictionary.cs
- RuleProcessor.cs
- DocComment.cs
- DocumentPage.cs
- BinaryNode.cs
- SoapSchemaMember.cs
- Cloud.cs
- Publisher.cs
- TableLayoutPanelBehavior.cs
- RegistrySecurity.cs
- Point.cs
- WebPartZoneBase.cs
- ToolboxComponentsCreatingEventArgs.cs
- HttpInputStream.cs
- VSWCFServiceContractGenerator.cs
- VisualTreeUtils.cs
- WorkflowEventArgs.cs
- HttpModuleActionCollection.cs
- CanonicalFontFamilyReference.cs
- MediaContext.cs
- DecoderFallbackWithFailureFlag.cs
- ToolStripRendererSwitcher.cs
- BindStream.cs
- FunctionDefinition.cs
- HelpKeywordAttribute.cs
- TemplateKey.cs
- TranslateTransform.cs
- AdditionalEntityFunctions.cs
- FrugalList.cs
- DateTimeStorage.cs
- DataGridViewCellLinkedList.cs
- TabRenderer.cs
- ImportCatalogPart.cs
- DrawTreeNodeEventArgs.cs
- ConfigurationManagerInternalFactory.cs
- MonthChangedEventArgs.cs
- XPathScanner.cs
- ContextConfiguration.cs
- NavigationService.cs
- GiveFeedbackEvent.cs
- Ipv6Element.cs
- FullTextLine.cs
- UdpChannelListener.cs
- Help.cs
- ModuleConfigurationInfo.cs
- XmlUTF8TextWriter.cs
- XamlLoadErrorInfo.cs
- ControlDesigner.cs
- HttpContextServiceHost.cs
- Label.cs
- InheritanceContextChangedEventManager.cs
- WebHttpEndpoint.cs
- SoapTypeAttribute.cs
- ProcessInputEventArgs.cs
- WmpBitmapDecoder.cs
- RuntimeArgumentHandle.cs
- Wildcard.cs
- User.cs
- Facet.cs
- SourceSwitch.cs
- OdbcDataReader.cs
- XPathCompiler.cs
- BaseValidator.cs
- LocalServiceSecuritySettings.cs
- MethodCallTranslator.cs
- SharedPerformanceCounter.cs
- HtmlInputFile.cs
- XmlWriterDelegator.cs
- ListControl.cs
- BamlReader.cs
- KeyedHashAlgorithm.cs
- MappingMetadataHelper.cs
- QueryReaderSettings.cs
- NamedPermissionSet.cs
- DataSourceProvider.cs
- AlternationConverter.cs
- _IPv6Address.cs
- CompareInfo.cs
- EditorZone.cs
- ExternalException.cs
- HttpResponseInternalWrapper.cs
- HtmlWindowCollection.cs
- LoadRetryConstantStrategy.cs
- TreeNodeBinding.cs
- XmlNode.cs
- IgnorePropertiesAttribute.cs
- ProviderConnectionPointCollection.cs