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
- RequiredAttributeAttribute.cs
- ErrorRuntimeConfig.cs
- Point3DValueSerializer.cs
- GlyphRunDrawing.cs
- DynamicValueConverter.cs
- PublisherIdentityPermission.cs
- RegexMatchCollection.cs
- ProxyWebPartConnectionCollection.cs
- ConstantExpression.cs
- QilExpression.cs
- XamlDesignerSerializationManager.cs
- ContextStaticAttribute.cs
- DataTableCollection.cs
- BitmapEffectGroup.cs
- ControlDesignerState.cs
- Crc32.cs
- GridProviderWrapper.cs
- BamlStream.cs
- FormViewInsertEventArgs.cs
- Figure.cs
- AccessViolationException.cs
- PaperSize.cs
- HttpCookiesSection.cs
- BindingGroup.cs
- ClientTargetCollection.cs
- Stackframe.cs
- UInt64.cs
- NetCodeGroup.cs
- ArgumentNullException.cs
- WebPartZoneBase.cs
- FilterEventArgs.cs
- BitmapEffectInput.cs
- ToolboxItem.cs
- DesignerHierarchicalDataSourceView.cs
- ListControlDesigner.cs
- PageClientProxyGenerator.cs
- DbProviderFactoriesConfigurationHandler.cs
- Light.cs
- ComponentDispatcher.cs
- XomlCompilerError.cs
- BinaryObjectWriter.cs
- FacetValueContainer.cs
- InvalidCastException.cs
- DelegateArgumentReference.cs
- ColorInterpolationModeValidation.cs
- MenuTracker.cs
- DataBinder.cs
- SchemaImporterExtensionsSection.cs
- AsynchronousChannelMergeEnumerator.cs
- UTF7Encoding.cs
- DirectoryObjectSecurity.cs
- NamespaceList.cs
- ListViewItemSelectionChangedEvent.cs
- PolygonHotSpot.cs
- CacheModeConverter.cs
- DataGridViewIntLinkedList.cs
- WebUtil.cs
- CaseInsensitiveComparer.cs
- DependencyPropertyChangedEventArgs.cs
- SqlDataSourceCustomCommandEditor.cs
- CreateUserWizard.cs
- PixelFormats.cs
- CryptoStream.cs
- JapaneseLunisolarCalendar.cs
- RightsManagementPermission.cs
- EntityDataReader.cs
- DynamicMethod.cs
- WebPartEditorCancelVerb.cs
- MemberAccessException.cs
- FilteredSchemaElementLookUpTable.cs
- MarkerProperties.cs
- SourceFileBuildProvider.cs
- ExtensionsSection.cs
- CookielessData.cs
- ObjectDataSourceEventArgs.cs
- SqlConnectionStringBuilder.cs
- MarshalByRefObject.cs
- CacheAxisQuery.cs
- UnsafeNativeMethods.cs
- TimeStampChecker.cs
- TextEditor.cs
- ByteStreamMessageEncodingElement.cs
- AutomationPattern.cs
- EdmSchemaAttribute.cs
- CacheDict.cs
- VectorCollectionConverter.cs
- HttpFileCollection.cs
- NameValueConfigurationCollection.cs
- RegexRunner.cs
- DataGridCellEditEndingEventArgs.cs
- ParseElement.cs
- SchemaHelper.cs
- EmitterCache.cs
- StreamResourceInfo.cs
- BinaryEditor.cs
- XmlSchemaSet.cs
- BaseCodePageEncoding.cs
- AutoGeneratedField.cs
- ApplicationActivator.cs
- ParameterBinding.cs