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
- Pkcs7Recipient.cs
- DecoderFallback.cs
- OracleBFile.cs
- DeclarativeCatalogPart.cs
- InvalidateEvent.cs
- CapabilitiesState.cs
- TextProviderWrapper.cs
- RowTypePropertyElement.cs
- MdiWindowListItemConverter.cs
- DropShadowBitmapEffect.cs
- ClientEventManager.cs
- ConnectionManagementElement.cs
- SqlDataSourceCustomCommandEditor.cs
- StylusTip.cs
- TextAnchor.cs
- EntitySqlQueryBuilder.cs
- TypeViewSchema.cs
- AdornerDecorator.cs
- ModelPropertyDescriptor.cs
- SupportingTokenListenerFactory.cs
- SqlCacheDependencyDatabase.cs
- MaterializeFromAtom.cs
- SchemaTypeEmitter.cs
- DynamicControlParameter.cs
- PrintDocument.cs
- XomlCompilerHelpers.cs
- DateTimeOffsetStorage.cs
- AppDomain.cs
- MD5CryptoServiceProvider.cs
- ToolStripItemClickedEventArgs.cs
- ButtonColumn.cs
- StackSpiller.Bindings.cs
- SafeBitVector32.cs
- DeleteIndexBinder.cs
- Screen.cs
- Double.cs
- ButtonColumn.cs
- WebPartCatalogCloseVerb.cs
- AuthenticatingEventArgs.cs
- BamlResourceDeserializer.cs
- DirectoryGroupQuery.cs
- documentsequencetextpointer.cs
- ObjectParameter.cs
- ListBase.cs
- RewritingProcessor.cs
- ProxyManager.cs
- IISUnsafeMethods.cs
- ContainerUtilities.cs
- CollectionConverter.cs
- OptimizedTemplateContent.cs
- DataGridViewSelectedCellCollection.cs
- CodeAttributeArgument.cs
- DeferredTextReference.cs
- WorkflowFileItem.cs
- FixedElement.cs
- unsafeIndexingFilterStream.cs
- DataGridViewImageCell.cs
- Operators.cs
- ColorPalette.cs
- OptimizedTemplateContent.cs
- WebPartRestoreVerb.cs
- Mappings.cs
- KeyValueConfigurationCollection.cs
- shaperfactory.cs
- RoutedEventArgs.cs
- TemplateKey.cs
- _ShellExpression.cs
- Positioning.cs
- SettingsContext.cs
- LeafCellTreeNode.cs
- Brush.cs
- SwitchAttribute.cs
- WorkflowRuntimeServiceElement.cs
- DiagnosticTraceRecords.cs
- Base64Decoder.cs
- DecoderReplacementFallback.cs
- SecurityTokenAuthenticator.cs
- InstallerTypeAttribute.cs
- IsolatedStorageFile.cs
- DataTemplate.cs
- CodeDirectiveCollection.cs
- RC2.cs
- SmtpNetworkElement.cs
- ListBindableAttribute.cs
- NullableDoubleAverageAggregationOperator.cs
- StateDesigner.cs
- FileUtil.cs
- XsltArgumentList.cs
- CodeEntryPointMethod.cs
- DataControlFieldsEditor.cs
- OleDbRowUpdatingEvent.cs
- MaterialCollection.cs
- Context.cs
- ProgressiveCrcCalculatingStream.cs
- ToolStripSplitStackLayout.cs
- RichTextBoxContextMenu.cs
- SymLanguageVendor.cs
- RefType.cs
- DefaultShape.cs
- CodeVariableReferenceExpression.cs