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
- dbenumerator.cs
- PropertyTab.cs
- ColorContext.cs
- AutomationPatternInfo.cs
- InfoCardSymmetricAlgorithm.cs
- MetaModel.cs
- UnsafeNativeMethodsTablet.cs
- ConfigurationSettings.cs
- UseLicense.cs
- XmlSchemaGroup.cs
- ApplicationCommands.cs
- SystemUdpStatistics.cs
- SizeChangedInfo.cs
- TypePresenter.xaml.cs
- PageParserFilter.cs
- IndexerNameAttribute.cs
- ColorConvertedBitmap.cs
- KeyFrames.cs
- SafeNativeMethods.cs
- DnsPermission.cs
- DataServiceOperationContext.cs
- DoubleLink.cs
- EventMappingSettings.cs
- BrowserCapabilitiesFactory.cs
- BezierSegment.cs
- RuleSetBrowserDialog.cs
- StrokeNode.cs
- Triangle.cs
- AppDomainShutdownMonitor.cs
- DirectoryGroupQuery.cs
- TrustManager.cs
- LicenseManager.cs
- StringToken.cs
- MappingMetadataHelper.cs
- AudioFormatConverter.cs
- TextTreeRootNode.cs
- transactioncontext.cs
- ChannelProtectionRequirements.cs
- SiteOfOriginContainer.cs
- IQueryable.cs
- StandardCommandToolStripMenuItem.cs
- Button.cs
- PageCatalogPart.cs
- ActivityTypeDesigner.xaml.cs
- TemplateBindingExtension.cs
- StringUtil.cs
- StreamGeometry.cs
- invalidudtexception.cs
- BinaryCommonClasses.cs
- ContentPropertyAttribute.cs
- SHA1.cs
- HttpHandlerActionCollection.cs
- TableLayoutPanelDesigner.cs
- InternalRelationshipCollection.cs
- ExpanderAutomationPeer.cs
- MasterPageParser.cs
- RuleSettings.cs
- AspNetHostingPermission.cs
- MasterPage.cs
- FilterException.cs
- ItemsChangedEventArgs.cs
- TextRange.cs
- SafeEventLogWriteHandle.cs
- DataSourceIDConverter.cs
- SamlAuthenticationStatement.cs
- ListViewItem.cs
- MenuItemCollection.cs
- WorkflowInstanceProvider.cs
- DesignerDataColumn.cs
- SimpleTableProvider.cs
- MeshGeometry3D.cs
- EdmScalarPropertyAttribute.cs
- WriteTimeStream.cs
- AssociationType.cs
- ExpressionList.cs
- ViewEventArgs.cs
- Bitmap.cs
- WebBrowsableAttribute.cs
- CodeMethodReturnStatement.cs
- DataBinder.cs
- HorizontalAlignConverter.cs
- LinqMaximalSubtreeNominator.cs
- BamlTreeMap.cs
- ServiceModelInstallComponent.cs
- ToolStripDropTargetManager.cs
- ReachSerializationCacheItems.cs
- FormatControl.cs
- SectionInput.cs
- PathFigure.cs
- NetworkCredential.cs
- TableCell.cs
- EntityViewGenerationAttribute.cs
- DbConnectionClosed.cs
- GenericTypeParameterBuilder.cs
- DataViewSettingCollection.cs
- ClientScriptManager.cs
- ProvidersHelper.cs
- ActivityInstanceReference.cs
- WSTransactionSection.cs
- GridView.cs