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
- TableTextElementCollectionInternal.cs
- Timer.cs
- IntSecurity.cs
- smtppermission.cs
- Ticks.cs
- Odbc32.cs
- DragDropManager.cs
- SqlFacetAttribute.cs
- Dictionary.cs
- SafeMILHandle.cs
- ChangeDirector.cs
- DynamicUpdateCommand.cs
- PropertyNames.cs
- IdentityReference.cs
- LeftCellWrapper.cs
- JsonDataContract.cs
- ApplicationTrust.cs
- DataGridViewAdvancedBorderStyle.cs
- BulletedListEventArgs.cs
- SchemaMerger.cs
- ActivityBuilderXamlWriter.cs
- Size3D.cs
- WorkingDirectoryEditor.cs
- DiscoveryClientBindingElement.cs
- _HTTPDateParse.cs
- DBPropSet.cs
- ServicePointManager.cs
- RotateTransform3D.cs
- XmlAttributeCache.cs
- EntityClassGenerator.cs
- EditorZoneBase.cs
- IndicFontClient.cs
- DesignerMetadata.cs
- DynamicDataRoute.cs
- XsltSettings.cs
- DependencyPropertyChangedEventArgs.cs
- VariableQuery.cs
- DataColumnMapping.cs
- FontFamilyValueSerializer.cs
- SymLanguageVendor.cs
- DataGridColumnFloatingHeader.cs
- AdjustableArrowCap.cs
- SoapEnumAttribute.cs
- Matrix3DValueSerializer.cs
- RelationshipConverter.cs
- DesignerHelpers.cs
- CreateUserWizard.cs
- WaitingCursor.cs
- ToolStripMenuItemDesigner.cs
- PassportIdentity.cs
- BoundingRectTracker.cs
- EntityDataSourceReferenceGroup.cs
- ParallelTimeline.cs
- Ray3DHitTestResult.cs
- InfoCardProofToken.cs
- SecurityUtils.cs
- EndpointAddressProcessor.cs
- LogRestartAreaEnumerator.cs
- DateTimeConverter.cs
- Vars.cs
- GcHandle.cs
- __TransparentProxy.cs
- XPathDocumentBuilder.cs
- PowerEase.cs
- BindingSourceDesigner.cs
- httpapplicationstate.cs
- PathStreamGeometryContext.cs
- UnicastIPAddressInformationCollection.cs
- TypeHelper.cs
- WinEventQueueItem.cs
- ISessionStateStore.cs
- PreviewPrintController.cs
- SevenBitStream.cs
- ContextStaticAttribute.cs
- ArrayConverter.cs
- DataServiceRequestOfT.cs
- DocumentReference.cs
- DateTimeOffset.cs
- FontFamily.cs
- UIElementParagraph.cs
- InternalPermissions.cs
- DiscreteKeyFrames.cs
- DeclarativeCatalogPart.cs
- TextFormatterHost.cs
- Ref.cs
- IntSecurity.cs
- _SSPISessionCache.cs
- XmlSequenceWriter.cs
- ITreeGenerator.cs
- XmlSchemaSimpleTypeUnion.cs
- ReferencedAssembly.cs
- ExceptionHelpers.cs
- ObjectComplexPropertyMapping.cs
- InvokerUtil.cs
- ViewSimplifier.cs
- Primitive.cs
- DataGridCaption.cs
- OdbcHandle.cs
- RealProxy.cs
- Symbol.cs