Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / NewXml / TreeIterator.cs / 1305376 / TreeIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- #pragma warning disable 618 // ignore obsolete warning about XmlDataDocument namespace System.Xml { 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.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PageBuildProvider.cs
- AnnotationHelper.cs
- SafeProcessHandle.cs
- sortedlist.cs
- ColorConvertedBitmap.cs
- PropertyOverridesDialog.cs
- CodeTypeReferenceSerializer.cs
- login.cs
- TimeoutStream.cs
- TemplateBuilder.cs
- ReliableOutputConnection.cs
- InfoCardSymmetricCrypto.cs
- SafeMarshalContext.cs
- DragEvent.cs
- ForEachAction.cs
- GridViewCellAutomationPeer.cs
- XmlSchemaAttributeGroupRef.cs
- XmlSchemaGroup.cs
- SurrogateEncoder.cs
- GeneralTransform3DGroup.cs
- QuestionEventArgs.cs
- RtfControlWordInfo.cs
- ResumeStoryboard.cs
- BuildProvidersCompiler.cs
- HTTPNotFoundHandler.cs
- SynchronizationScope.cs
- ASCIIEncoding.cs
- SqlMethodTransformer.cs
- ClosableStream.cs
- LassoHelper.cs
- FileInfo.cs
- GridToolTip.cs
- TemplateEditingVerb.cs
- Gdiplus.cs
- SR.cs
- SystemEvents.cs
- Viewport3DVisual.cs
- InputManager.cs
- ModuleBuilder.cs
- Listen.cs
- TextCollapsingProperties.cs
- BinHexEncoding.cs
- RuntimeResourceSet.cs
- CategoryAttribute.cs
- URLAttribute.cs
- SiteMapNodeItemEventArgs.cs
- LinkConverter.cs
- RemotingServices.cs
- AmbientValueAttribute.cs
- ResourceWriter.cs
- LockedBorderGlyph.cs
- ShapeTypeface.cs
- CryptoProvider.cs
- SoapFault.cs
- FamilyTypefaceCollection.cs
- TabControlAutomationPeer.cs
- CollectionBuilder.cs
- PropertyDescriptorComparer.cs
- Popup.cs
- TableLayoutSettingsTypeConverter.cs
- SafeRightsManagementSessionHandle.cs
- PackageRelationshipSelector.cs
- loginstatus.cs
- brushes.cs
- EmbossBitmapEffect.cs
- DesignerCapabilities.cs
- StringAttributeCollection.cs
- GridViewSortEventArgs.cs
- WpfSharedBamlSchemaContext.cs
- EntityDataSourceConfigureObjectContext.cs
- XmlTextEncoder.cs
- ErrorsHelper.cs
- filewebrequest.cs
- ExtendedProtectionPolicy.cs
- CustomCategoryAttribute.cs
- TextComposition.cs
- TargetControlTypeAttribute.cs
- MouseWheelEventArgs.cs
- MsmqHostedTransportManager.cs
- BitmapCache.cs
- MappedMetaModel.cs
- MenuCommand.cs
- RadioButtonAutomationPeer.cs
- FullTextLine.cs
- CryptographicAttribute.cs
- FixedTextContainer.cs
- LastQueryOperator.cs
- DialogWindow.cs
- SolidColorBrush.cs
- Convert.cs
- EventLogHandle.cs
- ViewStateModeByIdAttribute.cs
- MimeTypeAttribute.cs
- ToolStripItemEventArgs.cs
- ReferenceConverter.cs
- PropertyConverter.cs
- PixelFormats.cs
- XmlSchemaValidationException.cs
- MruCache.cs
- StandardCommands.cs