Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathDescendantIterator.cs / 1 / XPathDescendantIterator.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System.Xml.XPath;
internal class XPathDescendantIterator: XPathAxisIterator {
private int level = 0;
public XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {}
public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {}
public XPathDescendantIterator(XPathDescendantIterator it) : base(it) {
this.level = it.level;
}
public override XPathNodeIterator Clone() {
return new XPathDescendantIterator(this);
}
public override bool MoveNext() {
if (first) {
first = false;
if (matchSelf && Matches) {
position = 1;
return true;
}
}
while (true) {
if (nav.MoveToFirstChild()) {
level++;
} else {
while (true) {
if (level == 0) {
return false;
}
if (nav.MoveToNext()) {
break;
}
nav.MoveToParent();
level--;
}
}
if (Matches) {
position++;
return true;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System.Xml.XPath;
internal class XPathDescendantIterator: XPathAxisIterator {
private int level = 0;
public XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {}
public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {}
public XPathDescendantIterator(XPathDescendantIterator it) : base(it) {
this.level = it.level;
}
public override XPathNodeIterator Clone() {
return new XPathDescendantIterator(this);
}
public override bool MoveNext() {
if (first) {
first = false;
if (matchSelf && Matches) {
position = 1;
return true;
}
}
while (true) {
if (nav.MoveToFirstChild()) {
level++;
} else {
while (true) {
if (level == 0) {
return false;
}
if (nav.MoveToNext()) {
break;
}
nav.MoveToParent();
level--;
}
}
if (Matches) {
position++;
return true;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RemotingConfiguration.cs
- CodeDirectoryCompiler.cs
- HttpResponseInternalWrapper.cs
- XsdDateTime.cs
- ReplacementText.cs
- PasswordRecovery.cs
- DesignerVerb.cs
- AssemblyAssociatedContentFileAttribute.cs
- Timer.cs
- Bind.cs
- CodeDomLocalizationProvider.cs
- OdbcCommandBuilder.cs
- controlskin.cs
- DataGridHeaderBorder.cs
- AnimationClockResource.cs
- WebPartTransformerCollection.cs
- DbConnectionInternal.cs
- DependencyProperty.cs
- HelpEvent.cs
- LambdaExpression.cs
- ListBoxAutomationPeer.cs
- XmlNamespaceMappingCollection.cs
- ErrorFormatterPage.cs
- StylusPointPropertyUnit.cs
- JoinCqlBlock.cs
- BufferedWebEventProvider.cs
- EdmConstants.cs
- COMException.cs
- SrgsNameValueTag.cs
- DeviceContext2.cs
- EventRouteFactory.cs
- MultilineStringConverter.cs
- ClientOptions.cs
- BitStream.cs
- rsa.cs
- QueryableDataSourceEditData.cs
- PingReply.cs
- Border.cs
- ParserOptions.cs
- SettingsSection.cs
- SqlGenerator.cs
- Internal.cs
- TabControlEvent.cs
- XamlToRtfParser.cs
- FirstMatchCodeGroup.cs
- TabPanel.cs
- RsaSecurityTokenParameters.cs
- Contracts.cs
- TextStore.cs
- XamlWrappingReader.cs
- HTMLTextWriter.cs
- StringFormat.cs
- RangeExpression.cs
- CalendarTable.cs
- ImageDrawing.cs
- IntegerValidator.cs
- LogExtent.cs
- NameValueFileSectionHandler.cs
- VectorAnimation.cs
- LazyTextWriterCreator.cs
- CommandDevice.cs
- BreakRecordTable.cs
- RayHitTestParameters.cs
- EditingContext.cs
- HttpPostedFile.cs
- ReservationNotFoundException.cs
- AppLevelCompilationSectionCache.cs
- TabRenderer.cs
- SimpleHandlerFactory.cs
- SecurityTokenParametersEnumerable.cs
- ExternalDataExchangeService.cs
- Query.cs
- XhtmlBasicFormAdapter.cs
- TextServicesCompartmentContext.cs
- DataGridViewBand.cs
- ComponentManagerBroker.cs
- ReadOnlyCollection.cs
- RouteParametersHelper.cs
- DesignerAdRotatorAdapter.cs
- DocumentOrderQuery.cs
- CoreSwitches.cs
- XPathDescendantIterator.cs
- SchemaExporter.cs
- DbConnectionPoolCounters.cs
- AttributeSetAction.cs
- UpdateEventArgs.cs
- SiteMapNode.cs
- XmlSchemaDatatype.cs
- HttpRequestWrapper.cs
- ConsoleKeyInfo.cs
- XNodeSchemaApplier.cs
- IChannel.cs
- ApplicationManager.cs
- DuplicateWaitObjectException.cs
- NativeWindow.cs
- TypeUsage.cs
- Sql8ExpressionRewriter.cs
- OracleRowUpdatingEventArgs.cs
- StrokeNodeOperations.cs
- DateTimeOffset.cs