Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- XmlSchemaAppInfo.cs
- MiniParameterInfo.cs
- TraceListener.cs
- SecurityTokenResolver.cs
- CacheMemory.cs
- SettingsBase.cs
- SqlDuplicator.cs
- ToolboxComponentsCreatingEventArgs.cs
- BaseCodeDomTreeGenerator.cs
- CngKeyCreationParameters.cs
- PointLight.cs
- RepeatButtonAutomationPeer.cs
- SupportsPreviewControlAttribute.cs
- ConstantProjectedSlot.cs
- DataGridViewTextBoxEditingControl.cs
- ScopedMessagePartSpecification.cs
- ServiceInstallComponent.cs
- SqlDependency.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SQLDecimalStorage.cs
- GenericPrincipal.cs
- XmlnsDictionary.cs
- BaseDataListComponentEditor.cs
- MimeParameter.cs
- BuildProviderAppliesToAttribute.cs
- FontStretchConverter.cs
- SSmlParser.cs
- DesignerAttribute.cs
- SystemWebSectionGroup.cs
- TypeFieldSchema.cs
- DBConcurrencyException.cs
- StorageBasedPackageProperties.cs
- CopyNamespacesAction.cs
- BlurEffect.cs
- TraceUtils.cs
- AngleUtil.cs
- ListViewAutomationPeer.cs
- ModelVisual3D.cs
- ReferencedAssembly.cs
- _IPv4Address.cs
- ManagementObjectSearcher.cs
- DbDataSourceEnumerator.cs
- DesignerAttribute.cs
- _LoggingObject.cs
- BuilderElements.cs
- AssertUtility.cs
- DefaultParameterValueAttribute.cs
- PointAnimationClockResource.cs
- ForceCopyBuildProvider.cs
- XMLSyntaxException.cs
- KnownBoxes.cs
- GlyphCache.cs
- SequentialUshortCollection.cs
- LayoutTable.cs
- Point4D.cs
- ConfigurationValidatorAttribute.cs
- UpdatableWrapper.cs
- UpWmlPageAdapter.cs
- UIElementPropertyUndoUnit.cs
- DbConnectionHelper.cs
- ConfigViewGenerator.cs
- Sql8ExpressionRewriter.cs
- NonParentingControl.cs
- ObjectReferenceStack.cs
- TriggerCollection.cs
- UnsafeNativeMethodsCLR.cs
- BaseDataBoundControl.cs
- ScopelessEnumAttribute.cs
- LayoutTable.cs
- KeyManager.cs
- webbrowsersite.cs
- FrameAutomationPeer.cs
- EventDescriptor.cs
- MultiBindingExpression.cs
- ClrProviderManifest.cs
- ImageUrlEditor.cs
- SpecularMaterial.cs
- RichTextBox.cs
- HtmlTableCell.cs
- TypeSystem.cs
- Int16AnimationUsingKeyFrames.cs
- GridViewEditEventArgs.cs
- RegexCapture.cs
- StreamingContext.cs
- XmlNamedNodeMap.cs
- FixedSchema.cs
- XmlCodeExporter.cs
- HtmlTableRowCollection.cs
- VectorCollection.cs
- SecUtil.cs
- ExpressionWriter.cs
- configsystem.cs
- SqlCacheDependencyDatabaseCollection.cs
- SchemaInfo.cs
- QueryStringConverter.cs
- Semaphore.cs
- LicenseManager.cs
- TimeoutHelper.cs
- ApplicationManager.cs
- SoapHeaderException.cs