Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EdmComplexTypeAttribute.cs
- Span.cs
- WindowsListViewGroupSubsetLink.cs
- StorageConditionPropertyMapping.cs
- NumericPagerField.cs
- OverflowException.cs
- EdmItemError.cs
- PageCodeDomTreeGenerator.cs
- PersonalizationAdministration.cs
- XsltException.cs
- XmlChoiceIdentifierAttribute.cs
- OpCopier.cs
- InvalidPropValue.cs
- OutputCacheSettings.cs
- TablePattern.cs
- MetafileHeader.cs
- Rule.cs
- TextBreakpoint.cs
- IteratorDescriptor.cs
- HandlerFactoryCache.cs
- OdbcErrorCollection.cs
- SHA512CryptoServiceProvider.cs
- ListDataBindEventArgs.cs
- _HeaderInfo.cs
- Ipv6Element.cs
- UserControlParser.cs
- MobileComponentEditorPage.cs
- EditingCoordinator.cs
- MediaEntryAttribute.cs
- PersonalizationProvider.cs
- ImageListUtils.cs
- ReadWriteObjectLock.cs
- DataGridViewCellCancelEventArgs.cs
- MessageBox.cs
- KnownColorTable.cs
- CompoundFileReference.cs
- LayoutEngine.cs
- CollectionViewGroupInternal.cs
- PartialCachingControl.cs
- Helpers.cs
- WhitespaceRuleReader.cs
- DataGridViewBand.cs
- GradientBrush.cs
- SchemaImporterExtension.cs
- ContainerUtilities.cs
- DataColumnMappingCollection.cs
- ConfigXmlAttribute.cs
- WpfXamlType.cs
- DataGridPagingPage.cs
- Trigger.cs
- XmlAnyAttributeAttribute.cs
- FileLoadException.cs
- Effect.cs
- HostedTransportConfigurationManager.cs
- ValueSerializer.cs
- Parser.cs
- MaskDesignerDialog.cs
- TdsParserSessionPool.cs
- HttpRequestCacheValidator.cs
- cache.cs
- ComponentChangingEvent.cs
- SqlCaseSimplifier.cs
- SignatureGenerator.cs
- ParentUndoUnit.cs
- Clause.cs
- DynamicActionMessageFilter.cs
- TypeDescriptionProvider.cs
- ClrPerspective.cs
- ExpressionServices.cs
- EntityDataSourceView.cs
- AssemblyBuilder.cs
- OdbcConnectionPoolProviderInfo.cs
- ScriptMethodAttribute.cs
- EntityTransaction.cs
- DataListCommandEventArgs.cs
- ShapingEngine.cs
- VisualBrush.cs
- Clause.cs
- DesignOnlyAttribute.cs
- DataReaderContainer.cs
- ScriptDescriptor.cs
- ConfigurationStrings.cs
- Component.cs
- SchemaMapping.cs
- BitmapSource.cs
- CellParagraph.cs
- UniqueConstraint.cs
- BoundConstants.cs
- StickyNote.cs
- CodeTypeConstructor.cs
- XmlNullResolver.cs
- TimelineGroup.cs
- StreamUpdate.cs
- AnonymousIdentificationSection.cs
- UpdateException.cs
- SlotInfo.cs
- TextParentUndoUnit.cs
- TextParagraphView.cs
- XmlTextReaderImpl.cs
- HttpSysSettings.cs