Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- Message.cs
- StylusTip.cs
- ZipIOExtraFieldZip64Element.cs
- StateFinalizationActivity.cs
- DynamicActionMessageFilter.cs
- _LocalDataStore.cs
- IDReferencePropertyAttribute.cs
- ErrorRuntimeConfig.cs
- SendActivityValidator.cs
- XmlResolver.cs
- HttpServerVarsCollection.cs
- TemplateColumn.cs
- AssemblyInfo.cs
- FontCacheLogic.cs
- XmlAnyAttributeAttribute.cs
- SR.Designer.cs
- RPIdentityRequirement.cs
- EraserBehavior.cs
- InputScopeAttribute.cs
- compensatingcollection.cs
- LocatorGroup.cs
- Operators.cs
- XmlEncodedRawTextWriter.cs
- PerformanceCounterPermissionAttribute.cs
- SectionVisual.cs
- ReadWriteObjectLock.cs
- ExtentCqlBlock.cs
- DefaultAsyncDataDispatcher.cs
- DesignerDeviceConfig.cs
- DependencyPropertyChangedEventArgs.cs
- AdRotatorDesigner.cs
- SignalGate.cs
- TabPage.cs
- SqlCacheDependencyDatabaseCollection.cs
- SubqueryTrackingVisitor.cs
- IntegerFacetDescriptionElement.cs
- MetadataArtifactLoaderCompositeResource.cs
- DrawTreeNodeEventArgs.cs
- SchemaImporterExtension.cs
- HostingEnvironmentException.cs
- SqlException.cs
- PointCollectionConverter.cs
- OdbcException.cs
- DropAnimation.xaml.cs
- NullableConverter.cs
- PackWebRequest.cs
- ToolStripDropDownItemDesigner.cs
- XmlHelper.cs
- ByteBufferPool.cs
- TypeNameConverter.cs
- Bits.cs
- FillErrorEventArgs.cs
- CqlBlock.cs
- ConfigurationLockCollection.cs
- TableRowGroup.cs
- Int32RectValueSerializer.cs
- ServerValidateEventArgs.cs
- Thumb.cs
- HttpAsyncResult.cs
- Number.cs
- KerberosReceiverSecurityToken.cs
- ObjectParameterCollection.cs
- ScriptResourceHandler.cs
- ProxyManager.cs
- cryptoapiTransform.cs
- TextServicesLoader.cs
- DispatcherHooks.cs
- EdmComplexTypeAttribute.cs
- DataGridColumnHeaderAutomationPeer.cs
- EmptyQuery.cs
- CreateUserErrorEventArgs.cs
- OrderedDictionary.cs
- ConfigsHelper.cs
- DataPagerCommandEventArgs.cs
- BamlLocalizabilityResolver.cs
- WindowsProgressbar.cs
- InkPresenterAutomationPeer.cs
- MetadataArtifactLoaderResource.cs
- TextViewSelectionProcessor.cs
- ColorTransform.cs
- SharedConnectionWorkflowTransactionService.cs
- DoWorkEventArgs.cs
- FileLoadException.cs
- TransportListener.cs
- WorkflowServiceInstance.cs
- JsonWriter.cs
- ConfigurationStrings.cs
- StrokeIntersection.cs
- CodeIterationStatement.cs
- InstanceDataCollectionCollection.cs
- BitmapEffectOutputConnector.cs
- HtmlTableCellCollection.cs
- Publisher.cs
- XmlFileEditor.cs
- WmfPlaceableFileHeader.cs
- PropertyExpression.cs
- SqlUserDefinedAggregateAttribute.cs
- AllMembershipCondition.cs
- Style.cs
- BrowserCapabilitiesFactoryBase.cs