Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Data / System / NewXml / TreeIterator.cs / 1 / TreeIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.Data; using System.Diagnostics; // Iterates over non-attribute nodes internal sealed class TreeIterator : BaseTreeIterator { private XmlNode nodeTop; private XmlNode currentNode; internal TreeIterator( XmlNode nodeTop ) : base( ((XmlDataDocument)(nodeTop.OwnerDocument)).Mapper ) { Debug.Assert( nodeTop != null ); this.nodeTop = nodeTop; this.currentNode = nodeTop; } internal override void Reset() { currentNode = nodeTop; } internal override XmlNode CurrentNode { get { return currentNode; } } internal override bool Next() { XmlNode nextNode; // Try to move to the first child nextNode = currentNode.FirstChild; // No children, try next sibling if ( nextNode != null ) { currentNode = nextNode; return true; } return NextRight(); } internal override bool NextRight() { // Make sure we do not get past the nodeTop if we call NextRight on a just initialized iterator and nodeTop has no children if ( currentNode == nodeTop ) { currentNode = null; return false; } XmlNode nextNode = currentNode.NextSibling; if ( nextNode != null ) { currentNode = nextNode; return true; } // No next sibling, try the first sibling of from the parent chain nextNode = currentNode; while ( nextNode != nodeTop && nextNode.NextSibling == null ) nextNode = nextNode.ParentNode; if ( nextNode == nodeTop ) { currentNode = null; return false; } currentNode = nextNode.NextSibling; Debug.Assert( currentNode != null ); return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlAttributeCollection.cs
- DocumentPageHost.cs
- ListenUriMode.cs
- PropertyChangedEventArgs.cs
- UserControlParser.cs
- FullTextBreakpoint.cs
- Rect3DConverter.cs
- RecommendedAsConfigurableAttribute.cs
- ListViewGroup.cs
- columnmapfactory.cs
- CommandExpr.cs
- storagemappingitemcollection.viewdictionary.cs
- XhtmlTextWriter.cs
- ScrollBarRenderer.cs
- FocusTracker.cs
- RawStylusInput.cs
- StatusBarDrawItemEvent.cs
- TextRunTypographyProperties.cs
- VisualTreeUtils.cs
- ImageAutomationPeer.cs
- PropertyItem.cs
- BaseConfigurationRecord.cs
- EditingCommands.cs
- TypeForwardedToAttribute.cs
- WebBaseEventKeyComparer.cs
- SeparatorAutomationPeer.cs
- TabControl.cs
- ResXResourceReader.cs
- _PooledStream.cs
- ScrollData.cs
- PersonalizationProviderHelper.cs
- PartManifestEntry.cs
- MimeTextImporter.cs
- MessageBox.cs
- CircleEase.cs
- EndpointReference.cs
- DataFormats.cs
- SamlConditions.cs
- WebResourceAttribute.cs
- _DomainName.cs
- ItemsControlAutomationPeer.cs
- OuterGlowBitmapEffect.cs
- RequiredAttributeAttribute.cs
- FixedSOMPageConstructor.cs
- BitConverter.cs
- WSHttpBindingElement.cs
- BooleanKeyFrameCollection.cs
- JournalNavigationScope.cs
- HostingEnvironment.cs
- HtmlImage.cs
- StylusCollection.cs
- MembershipSection.cs
- ConstructorArgumentAttribute.cs
- AuthenticationModuleElement.cs
- AttachInfo.cs
- userdatakeys.cs
- PersistenceTypeAttribute.cs
- WebPartConnection.cs
- FormViewDesigner.cs
- BoolExpressionVisitors.cs
- XmlNamespaceDeclarationsAttribute.cs
- WebPartVerb.cs
- GridViewCancelEditEventArgs.cs
- ScriptingJsonSerializationSection.cs
- BaseAsyncResult.cs
- XmlTypeMapping.cs
- DESCryptoServiceProvider.cs
- CellRelation.cs
- DataTablePropertyDescriptor.cs
- NumberSubstitution.cs
- SrgsElementList.cs
- DataGridViewSelectedColumnCollection.cs
- SQLString.cs
- WorkflowPersistenceService.cs
- CodeExporter.cs
- WeakReference.cs
- SqlGatherProducedAliases.cs
- SimpleRecyclingCache.cs
- PolyQuadraticBezierSegment.cs
- AccessibleObject.cs
- SupportsEventValidationAttribute.cs
- PackageDigitalSignature.cs
- ClientApiGenerator.cs
- Pkcs7Recipient.cs
- StringValidator.cs
- ExtensibleClassFactory.cs
- DataGridViewCellCancelEventArgs.cs
- CapabilitiesUse.cs
- ValidatorUtils.cs
- Form.cs
- PartialArray.cs
- MimeTypePropertyAttribute.cs
- WindowsRegion.cs
- SpellerInterop.cs
- TogglePattern.cs
- ToolStripDropDownButton.cs
- RepeaterCommandEventArgs.cs
- IntellisenseTextBox.cs
- AttributeParameterInfo.cs
- TabletDevice.cs