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
- CheckBoxStandardAdapter.cs
- ReadWriteObjectLock.cs
- WorkflowWebService.cs
- WebBrowser.cs
- TreeViewItemAutomationPeer.cs
- DictionaryContent.cs
- HwndSource.cs
- NoneExcludedImageIndexConverter.cs
- VirtualPathUtility.cs
- ColumnResizeAdorner.cs
- CommittableTransaction.cs
- ModelToObjectValueConverter.cs
- InputLanguageManager.cs
- GeneralTransformCollection.cs
- ReaderWriterLock.cs
- GroupStyle.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- codemethodreferenceexpression.cs
- SqlProcedureAttribute.cs
- WS2007HttpBinding.cs
- AssemblyBuilder.cs
- SoapFormatterSinks.cs
- LocatorManager.cs
- XPathMessageFilterElementCollection.cs
- Conditional.cs
- ClientUtils.cs
- PolyQuadraticBezierSegment.cs
- OutputCacheSettings.cs
- WebEvents.cs
- TopClause.cs
- HashHelper.cs
- infer.cs
- DataGridViewSelectedCellCollection.cs
- PropertyValueChangedEvent.cs
- ReachNamespaceInfo.cs
- PageCanvasSize.cs
- Win32Exception.cs
- SocketInformation.cs
- CommandField.cs
- manifestimages.cs
- SubtreeProcessor.cs
- TrustLevelCollection.cs
- NumberFormatInfo.cs
- XmlSchemaExternal.cs
- HtmlInputPassword.cs
- BindingCollection.cs
- UnsafeNativeMethods.cs
- ResourceFallbackManager.cs
- FileDialog_Vista_Interop.cs
- IndexerNameAttribute.cs
- PerformanceCounterLib.cs
- AdornedElementPlaceholder.cs
- TextTreeExtractElementUndoUnit.cs
- SafeIUnknown.cs
- DropSource.cs
- SemaphoreSecurity.cs
- ZeroOpNode.cs
- NativeActivityAbortContext.cs
- PageThemeCodeDomTreeGenerator.cs
- RegisteredArrayDeclaration.cs
- TemplateField.cs
- SQLBinaryStorage.cs
- EmptyStringExpandableObjectConverter.cs
- PropertyMetadata.cs
- HMACSHA512.cs
- GPRECTF.cs
- SchemaNames.cs
- UpdateManifestForBrowserApplication.cs
- WebAdminConfigurationHelper.cs
- CommandBindingCollection.cs
- EventRoute.cs
- TokenizerHelper.cs
- ImageListStreamer.cs
- SerializerProvider.cs
- SoapProtocolReflector.cs
- SHA384.cs
- BCLDebug.cs
- DbDataRecord.cs
- KeyInfo.cs
- PlatformCulture.cs
- Switch.cs
- ServiceDescriptions.cs
- HttpDigestClientElement.cs
- ToolstripProfessionalRenderer.cs
- SeparatorAutomationPeer.cs
- BufferedMessageData.cs
- WorkflowExecutor.cs
- ToolStripStatusLabel.cs
- safelink.cs
- SqlMethodAttribute.cs
- CollectionCodeDomSerializer.cs
- HandleRef.cs
- MethodBuilder.cs
- SearchForVirtualItemEventArgs.cs
- RequiredAttributeAttribute.cs
- OutputCacheProfileCollection.cs
- CheckBoxBaseAdapter.cs
- UIElement.cs
- CodeIdentifiers.cs
- TableChangeProcessor.cs