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
- WinInet.cs
- ObjectDataSourceStatusEventArgs.cs
- TableRow.cs
- SqlClientWrapperSmiStream.cs
- LinkedResourceCollection.cs
- XmlAttributeCache.cs
- XmlNamespaceManager.cs
- WCFModelStrings.Designer.cs
- GraphicsState.cs
- GridViewRow.cs
- SafeCoTaskMem.cs
- LogAppendAsyncResult.cs
- Debug.cs
- RenderDataDrawingContext.cs
- AnonymousIdentificationModule.cs
- StatusBarPanel.cs
- SqlSelectStatement.cs
- BinarySerializer.cs
- ObjectListCommand.cs
- ControllableStoryboardAction.cs
- IIS7UserPrincipal.cs
- DbMetaDataCollectionNames.cs
- ProcessModelSection.cs
- WindowsScrollBarBits.cs
- ParserContext.cs
- EndPoint.cs
- EntityContainerAssociationSetEnd.cs
- ButtonBaseAutomationPeer.cs
- CommandLibraryHelper.cs
- LogicalExpr.cs
- DictionaryCustomTypeDescriptor.cs
- TypeInitializationException.cs
- ModifierKeysValueSerializer.cs
- BindableAttribute.cs
- RadioButtonList.cs
- DBBindings.cs
- MatrixCamera.cs
- DrawingState.cs
- XmlSchemaExternal.cs
- WebPartConnectVerb.cs
- Container.cs
- ProxyWebPartConnectionCollection.cs
- Sentence.cs
- DeploymentSectionCache.cs
- Int16.cs
- DrawListViewColumnHeaderEventArgs.cs
- FullTextBreakpoint.cs
- AtomicFile.cs
- UniqueID.cs
- WindowsIdentity.cs
- RangeValidator.cs
- FixedHyperLink.cs
- DateTimeSerializationSection.cs
- XamlLoadErrorInfo.cs
- DiagnosticTrace.cs
- InternalRelationshipCollection.cs
- RuleProcessor.cs
- TransportListener.cs
- EncodingNLS.cs
- RawContentTypeMapper.cs
- querybuilder.cs
- CompModSwitches.cs
- Attributes.cs
- Selection.cs
- IxmlLineInfo.cs
- WebConfigurationHost.cs
- AnnotationResource.cs
- SymDocumentType.cs
- PrimitiveXmlSerializers.cs
- RectAnimationUsingKeyFrames.cs
- RuntimeArgumentHandle.cs
- TraceProvider.cs
- WSFederationHttpBinding.cs
- DataFormats.cs
- SoapHeaderAttribute.cs
- DoubleLink.cs
- DataDocumentXPathNavigator.cs
- MetadataArtifactLoaderFile.cs
- HandledEventArgs.cs
- SessionStateSection.cs
- MarkupCompilePass2.cs
- SelectionItemProviderWrapper.cs
- RuntimeConfig.cs
- SafeNativeMethodsOther.cs
- TimeSpanConverter.cs
- ToolStripSeparator.cs
- PerformanceCountersElement.cs
- DataGridCaption.cs
- DataFormat.cs
- MouseGestureValueSerializer.cs
- WorkflowServiceHostFactory.cs
- StorageSetMapping.cs
- EventDriven.cs
- SchemaCollectionPreprocessor.cs
- LinkConverter.cs
- InkCanvasSelection.cs
- Single.cs
- PackageFilter.cs
- ExpressionNormalizer.cs
- CodeTypeReferenceCollection.cs