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
- SamlSerializer.cs
- FaultDescription.cs
- SQLBytesStorage.cs
- XmlDataSource.cs
- ArrayMergeHelper.cs
- FixUpCollection.cs
- Transform3D.cs
- CorrelationManager.cs
- DataGridViewLayoutData.cs
- Action.cs
- Annotation.cs
- FontEmbeddingManager.cs
- AnimationTimeline.cs
- UrlUtility.cs
- TextServicesPropertyRanges.cs
- _CookieModule.cs
- AvTrace.cs
- ParallelTimeline.cs
- XmlnsDefinitionAttribute.cs
- FamilyCollection.cs
- WebControlsSection.cs
- RotateTransform3D.cs
- XmlNodeChangedEventManager.cs
- Formatter.cs
- SqlBuilder.cs
- SymmetricKeyWrap.cs
- InternalControlCollection.cs
- DocumentGridContextMenu.cs
- WindowsAuthenticationModule.cs
- StartUpEventArgs.cs
- StringSorter.cs
- FileDialog_Vista.cs
- MeshGeometry3D.cs
- HealthMonitoringSection.cs
- GroupBoxAutomationPeer.cs
- XmlTextWriter.cs
- dsa.cs
- ThreadSafeList.cs
- RowSpanVector.cs
- PerformanceCounterNameAttribute.cs
- SiteMapSection.cs
- LinearGradientBrush.cs
- QilPatternVisitor.cs
- DocumentPageViewAutomationPeer.cs
- DataGridHeaderBorder.cs
- SoapClientProtocol.cs
- MediaElementAutomationPeer.cs
- KerberosReceiverSecurityToken.cs
- ResXResourceReader.cs
- CommandEventArgs.cs
- CLSCompliantAttribute.cs
- TextureBrush.cs
- RegexParser.cs
- DesignerForm.cs
- WebChannelFactory.cs
- LogReserveAndAppendState.cs
- OrthographicCamera.cs
- NCryptNative.cs
- SqlStatistics.cs
- XamlToRtfParser.cs
- ZipFileInfoCollection.cs
- LayoutEditorPart.cs
- ObjectManager.cs
- AssociationTypeEmitter.cs
- UniqueID.cs
- ObjectDataSourceDisposingEventArgs.cs
- FileInfo.cs
- ListParaClient.cs
- TreeBuilderBamlTranslator.cs
- Size3DConverter.cs
- EntityPropertyMappingAttribute.cs
- SqlMethods.cs
- SimpleApplicationHost.cs
- ContextQuery.cs
- Rotation3D.cs
- RepeatButtonAutomationPeer.cs
- TrustLevel.cs
- TableHeaderCell.cs
- TextRangeEditLists.cs
- cookiecontainer.cs
- SqlTriggerContext.cs
- KeyValueSerializer.cs
- SimpleType.cs
- HighlightComponent.cs
- DriveNotFoundException.cs
- QuaternionConverter.cs
- FaultCallbackWrapper.cs
- DesignerTransaction.cs
- UserControlDesigner.cs
- CommandTreeTypeHelper.cs
- FileDataSourceCache.cs
- ApplicationFileCodeDomTreeGenerator.cs
- UserNamePasswordValidator.cs
- DataGridViewColumnCollection.cs
- UserControlBuildProvider.cs
- FormsAuthenticationTicket.cs
- ItemCheckEvent.cs
- StorageTypeMapping.cs
- GlyphRunDrawing.cs
- HttpCacheVary.cs