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
- DataException.cs
- UnrecognizedAssertionsBindingElement.cs
- PEFileReader.cs
- HtmlContainerControl.cs
- WebReferenceCollection.cs
- EncodedStreamFactory.cs
- ExceptionHandler.cs
- IdnElement.cs
- DataDesignUtil.cs
- ImmutablePropertyDescriptorGridEntry.cs
- __Error.cs
- URLString.cs
- Msec.cs
- TdsParserStaticMethods.cs
- ValidationHelpers.cs
- InheritanceRules.cs
- ConvertEvent.cs
- WebResponse.cs
- AsymmetricKeyExchangeDeformatter.cs
- TrackingProfileDeserializationException.cs
- SqlUdtInfo.cs
- ListViewInsertEventArgs.cs
- SecurityContextSecurityToken.cs
- XmlObjectSerializerWriteContextComplex.cs
- PersistStreamTypeWrapper.cs
- DocumentScope.cs
- filewebrequest.cs
- XmlFormatWriterGenerator.cs
- QilParameter.cs
- NameObjectCollectionBase.cs
- DrawToolTipEventArgs.cs
- DiagnosticSection.cs
- ReadOnlyHierarchicalDataSource.cs
- RegisteredHiddenField.cs
- AssemblyName.cs
- PtsPage.cs
- HelpPage.cs
- TextBlock.cs
- HtmlTableRow.cs
- WindowAutomationPeer.cs
- InkPresenter.cs
- Multiply.cs
- IChannel.cs
- FamilyTypeface.cs
- srgsitem.cs
- DesignUtil.cs
- XPathScanner.cs
- RootContext.cs
- datacache.cs
- TextDpi.cs
- linebase.cs
- GradientBrush.cs
- PrintDialog.cs
- FlowLayout.cs
- XmlArrayItemAttributes.cs
- updatecommandorderer.cs
- StdValidatorsAndConverters.cs
- SharedRuntimeState.cs
- ImageKeyConverter.cs
- XmlAttributeAttribute.cs
- ListItemCollection.cs
- CloseCryptoHandleRequest.cs
- XmlReflectionMember.cs
- Listbox.cs
- ExpressionBuilderCollection.cs
- BamlReader.cs
- LongTypeConverter.cs
- EmptyStringExpandableObjectConverter.cs
- ScrollItemProviderWrapper.cs
- PageHandlerFactory.cs
- KeyEventArgs.cs
- DesignTimeTemplateParser.cs
- CFStream.cs
- SqlCaseSimplifier.cs
- MarshalDirectiveException.cs
- UriTemplateDispatchFormatter.cs
- WindowsListViewGroupHelper.cs
- PropertyPath.cs
- HotSpotCollectionEditor.cs
- validationstate.cs
- ExtendedTransformFactory.cs
- ReferencedAssembly.cs
- BidPrivateBase.cs
- PageCanvasSize.cs
- EntityParameter.cs
- DbDataReader.cs
- ShimAsPublicXamlType.cs
- SqlTriggerContext.cs
- RuntimeVariablesExpression.cs
- MethodBuilder.cs
- JumpItem.cs
- AffineTransform3D.cs
- Header.cs
- XmlCDATASection.cs
- PageContentAsyncResult.cs
- DocumentApplicationJournalEntry.cs
- GraphicsPath.cs
- PenLineJoinValidation.cs
- And.cs
- Configuration.cs