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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Light.cs
- WebPartTracker.cs
- AlphabeticalEnumConverter.cs
- SnapLine.cs
- EnumType.cs
- OracleColumn.cs
- IisTraceWebEventProvider.cs
- SharedDp.cs
- NegotiateStream.cs
- OwnerDrawPropertyBag.cs
- UInt32Storage.cs
- SafeViewOfFileHandle.cs
- SoapSchemaExporter.cs
- GatewayIPAddressInformationCollection.cs
- AbandonedMutexException.cs
- DataBindingCollection.cs
- GeneralTransform.cs
- panel.cs
- Socket.cs
- Utility.cs
- TextDpi.cs
- UInt64Storage.cs
- InputMethodStateChangeEventArgs.cs
- ModuleBuilderData.cs
- AppSettingsExpressionEditor.cs
- EntitySetBase.cs
- WSSecurityJan2004.cs
- WebEvents.cs
- CollectionBase.cs
- HotSpotCollection.cs
- MetadataImporterQuotas.cs
- ListBindingConverter.cs
- ActivityInterfaces.cs
- TemplateApplicationHelper.cs
- SetterBaseCollection.cs
- RSACryptoServiceProvider.cs
- QilName.cs
- cookieexception.cs
- grammarelement.cs
- DetailsViewModeEventArgs.cs
- ProgressChangedEventArgs.cs
- XmlDocumentViewSchema.cs
- NavigationPropertySingletonExpression.cs
- AmbientEnvironment.cs
- PeerPresenceInfo.cs
- AsymmetricKeyExchangeDeformatter.cs
- DiscoveryOperationContextExtension.cs
- DataColumnChangeEvent.cs
- SQLChars.cs
- SqlUdtInfo.cs
- HttpHeaderCollection.cs
- Event.cs
- ToggleButtonAutomationPeer.cs
- ContentValidator.cs
- hwndwrapper.cs
- DataKey.cs
- XmlSchemaSimpleTypeRestriction.cs
- ToolboxItemLoader.cs
- Canonicalizers.cs
- VSDExceptions.cs
- AsyncContentLoadedEventArgs.cs
- Expressions.cs
- MatrixStack.cs
- VectorAnimationUsingKeyFrames.cs
- SeverityFilter.cs
- UnsafeNativeMethods.cs
- SqlProviderManifest.cs
- WebBrowser.cs
- MessageQueueAccessControlEntry.cs
- TypeUsage.cs
- ListBox.cs
- NativeMethods.cs
- MediaScriptCommandRoutedEventArgs.cs
- FontSizeConverter.cs
- ComponentResourceKeyConverter.cs
- TextUtf8RawTextWriter.cs
- SharedPersonalizationStateInfo.cs
- Helper.cs
- WsdlHelpGeneratorElement.cs
- ParserStreamGeometryContext.cs
- ObjectQueryProvider.cs
- DesigntimeLicenseContextSerializer.cs
- MenuItemBinding.cs
- XmlCharCheckingWriter.cs
- ItemCollection.cs
- DataObjectFieldAttribute.cs
- ObjRef.cs
- BinaryFormatterWriter.cs
- ConnectionProviderAttribute.cs
- Vector3dCollection.cs
- TargetControlTypeCache.cs
- RectangleF.cs
- DBBindings.cs
- ProxyWebPartConnectionCollection.cs
- EnvironmentPermission.cs
- PointLightBase.cs
- RectangleF.cs
- CollectionCodeDomSerializer.cs
- KeyboardEventArgs.cs
- CallContext.cs