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
- returneventsaver.cs
- SecureConversationSecurityTokenParameters.cs
- RelatedEnd.cs
- GenerateScriptTypeAttribute.cs
- PointF.cs
- SystemFonts.cs
- SqlDataSourceTableQuery.cs
- DataTrigger.cs
- ImageBrush.cs
- ColumnPropertiesGroup.cs
- SplitterPanel.cs
- InputLanguageSource.cs
- MsmqChannelListenerBase.cs
- ScriptReferenceBase.cs
- ToolStripItemEventArgs.cs
- InvariantComparer.cs
- ConfigXmlAttribute.cs
- Rotation3D.cs
- TdsRecordBufferSetter.cs
- HttpProfileGroupBase.cs
- ApplyImportsAction.cs
- UnauthorizedAccessException.cs
- WebPartMenuStyle.cs
- DbSetClause.cs
- SqlFactory.cs
- DataGridViewUtilities.cs
- QueryContinueDragEvent.cs
- SmiSettersStream.cs
- XPathNode.cs
- XmlSchemaRedefine.cs
- EDesignUtil.cs
- namescope.cs
- ScrollItemPatternIdentifiers.cs
- WebProxyScriptElement.cs
- ObjectHandle.cs
- TimelineGroup.cs
- HitTestDrawingContextWalker.cs
- Int32RectConverter.cs
- TextUtf8RawTextWriter.cs
- MetadataCacheItem.cs
- DesignerRegionMouseEventArgs.cs
- IisTraceListener.cs
- EntityExpressionVisitor.cs
- ObjectNotFoundException.cs
- ReflectionServiceProvider.cs
- RenderContext.cs
- XmlNullResolver.cs
- SqlConnectionHelper.cs
- ImageMetadata.cs
- HtmlImage.cs
- WebPartManager.cs
- LogFlushAsyncResult.cs
- EventlogProvider.cs
- RuleSettingsCollection.cs
- InternalConfigSettingsFactory.cs
- ActiveXHelper.cs
- SpnEndpointIdentity.cs
- TextBoxLine.cs
- AddInContractAttribute.cs
- Deflater.cs
- TypedTableBase.cs
- SimpleHandlerFactory.cs
- SecureEnvironment.cs
- LocatorPart.cs
- DesignTimeVisibleAttribute.cs
- TickBar.cs
- FileDialog_Vista_Interop.cs
- DiscoveryDocumentReference.cs
- BufferedWebEventProvider.cs
- MaskedTextBox.cs
- GrammarBuilderBase.cs
- MouseOverProperty.cs
- Span.cs
- DocumentCollection.cs
- StructuralCache.cs
- ByteStorage.cs
- ControlDesigner.cs
- ExcludePathInfo.cs
- IdentitySection.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Parsers.cs
- XmlSchemaInclude.cs
- diagnosticsswitches.cs
- ComponentDispatcher.cs
- File.cs
- TextViewDesigner.cs
- MethodImplAttribute.cs
- XmlReader.cs
- WebPartTransformerAttribute.cs
- SerializationFieldInfo.cs
- HttpContextWrapper.cs
- X509ChainPolicy.cs
- ModelPerspective.cs
- SqlDataSourceFilteringEventArgs.cs
- PropertyGrid.cs
- OrderedParallelQuery.cs
- ViewStateException.cs
- Rect3DValueSerializer.cs
- CultureSpecificCharacterBufferRange.cs
- CachedPathData.cs