Code:
/ FX-1434 / FX-1434 / 1.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
- ShaderEffect.cs
- xmlsaver.cs
- ProcessProtocolHandler.cs
- DataRecord.cs
- ServicesUtilities.cs
- QilStrConcatenator.cs
- LoginAutoFormat.cs
- AmbientProperties.cs
- Module.cs
- PolyLineSegmentFigureLogic.cs
- recordstatefactory.cs
- PropertyMetadata.cs
- SqlDataSourceView.cs
- HttpModulesInstallComponent.cs
- PaperSource.cs
- ConfigurationPropertyAttribute.cs
- PartitionResolver.cs
- PropertyEmitterBase.cs
- ArcSegment.cs
- AliasGenerator.cs
- XmlCharCheckingReader.cs
- InheritanceRules.cs
- AutomationEvent.cs
- CroppedBitmap.cs
- SecureUICommand.cs
- DesignerActionListCollection.cs
- ProxyWebPartConnectionCollection.cs
- EntityKeyElement.cs
- ProxyElement.cs
- TypeDelegator.cs
- OleDbParameter.cs
- Point3DAnimation.cs
- MarkupExtensionParser.cs
- SqlBooleanMismatchVisitor.cs
- HwndSourceKeyboardInputSite.cs
- UpDownBase.cs
- TableRowGroup.cs
- XDRSchema.cs
- LayoutTableCell.cs
- EntityContainerEmitter.cs
- WindowsPen.cs
- WebPartDisplayModeEventArgs.cs
- ExpressionPrefixAttribute.cs
- FormClosingEvent.cs
- TypedReference.cs
- CircleHotSpot.cs
- ScriptRef.cs
- tooltip.cs
- XmlSerializerSection.cs
- VScrollProperties.cs
- WizardSideBarListControlItemEventArgs.cs
- WebCodeGenerator.cs
- LinqDataSourceHelper.cs
- WebPartMenuStyle.cs
- Version.cs
- EventRoute.cs
- RemotingServices.cs
- TypedTableBase.cs
- ToolStripItemEventArgs.cs
- HttpListenerRequestUriBuilder.cs
- PageThemeCodeDomTreeGenerator.cs
- HttpServerUtilityWrapper.cs
- NotificationContext.cs
- AdornerLayer.cs
- ActivityInstanceReference.cs
- ItemsControlAutomationPeer.cs
- CustomErrorsSection.cs
- SiteMapPath.cs
- Baml6Assembly.cs
- Span.cs
- SecureConversationSecurityTokenParameters.cs
- Viewport3DAutomationPeer.cs
- Icon.cs
- LineBreak.cs
- DbParameterCollectionHelper.cs
- MobileControlsSectionHandler.cs
- MemberHolder.cs
- NotEqual.cs
- Part.cs
- TextContainer.cs
- PoisonMessageException.cs
- AsynchronousChannel.cs
- OleDbRowUpdatingEvent.cs
- Model3D.cs
- XmlBufferReader.cs
- FileAuthorizationModule.cs
- configsystem.cs
- VBIdentifierDesigner.xaml.cs
- XmlHierarchicalEnumerable.cs
- ComponentResourceKeyConverter.cs
- SRGSCompiler.cs
- CodeDomSerializerException.cs
- _NestedMultipleAsyncResult.cs
- HostedNamedPipeTransportManager.cs
- _Semaphore.cs
- ElementAtQueryOperator.cs
- ObjectContext.cs
- ReadOnlyDataSourceView.cs
- SqlMultiplexer.cs
- CalculatedColumn.cs