Code:
/ DotNET / DotNET / 8.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
- RemoteWebConfigurationHostStream.cs
- ContravarianceAdapter.cs
- LinkedResourceCollection.cs
- NamespaceList.cs
- ProcessHostMapPath.cs
- MenuEventArgs.cs
- LinkUtilities.cs
- ResolveResponse.cs
- UInt16Storage.cs
- LayoutEngine.cs
- XmlReflectionMember.cs
- ValidationRuleCollection.cs
- SqlDataSourceConnectionPanel.cs
- StreamWriter.cs
- EncodingDataItem.cs
- DataGridPageChangedEventArgs.cs
- TreeNodeCollection.cs
- DescriptionAttribute.cs
- XamlSerializerUtil.cs
- Exception.cs
- FixedDocumentPaginator.cs
- StyleSheetComponentEditor.cs
- GeneratedCodeAttribute.cs
- Style.cs
- RetriableClipboard.cs
- LabelEditEvent.cs
- AssemblyInfo.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- SecurityCriticalDataForSet.cs
- PictureBox.cs
- TreeSet.cs
- ProfessionalColorTable.cs
- AncillaryOps.cs
- TemplateEditingVerb.cs
- HtmlWindowCollection.cs
- RelatedCurrencyManager.cs
- ConfigurationStrings.cs
- GlyphRunDrawing.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- PointHitTestParameters.cs
- cookiecollection.cs
- EpmAttributeNameBuilder.cs
- SqlDataReader.cs
- FlowLayoutPanel.cs
- LocatorManager.cs
- ToolStripPanelRow.cs
- IdentityReference.cs
- GridEntry.cs
- RelationshipManager.cs
- Encoder.cs
- PrintingPermissionAttribute.cs
- ConfigUtil.cs
- X509Certificate2.cs
- EntityContainerRelationshipSetEnd.cs
- ActivityTypeDesigner.xaml.cs
- SignalGate.cs
- SubpageParagraph.cs
- X509Chain.cs
- UserControl.cs
- GeneratedView.cs
- TabControl.cs
- ResourcePermissionBaseEntry.cs
- IndependentAnimationStorage.cs
- ContainerAction.cs
- XamlWriter.cs
- ipaddressinformationcollection.cs
- TrustManager.cs
- ClaimSet.cs
- SqlBooleanizer.cs
- FlowSwitch.cs
- InputScopeManager.cs
- IPPacketInformation.cs
- RichTextBox.cs
- GestureRecognitionResult.cs
- ResolveNameEventArgs.cs
- UnionCqlBlock.cs
- InvalidPrinterException.cs
- Mapping.cs
- SQLDoubleStorage.cs
- ACE.cs
- BuildProvider.cs
- EpmHelper.cs
- Mutex.cs
- FtpCachePolicyElement.cs
- SafeProcessHandle.cs
- UserControlDocumentDesigner.cs
- SpellerStatusTable.cs
- ProgressPage.cs
- JournalEntry.cs
- CommonObjectSecurity.cs
- NumberSubstitution.cs
- BypassElement.cs
- DataSetMappper.cs
- FocusTracker.cs
- EventListener.cs
- WebPartExportVerb.cs
- WebPartHelpVerb.cs
- FlowLayoutSettings.cs
- CodeNamespaceImport.cs
- PerformanceCounter.cs