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
- XmlExpressionDumper.cs
- BackStopAuthenticationModule.cs
- QueryableDataSourceHelper.cs
- StateMachineExecutionState.cs
- TTSEngineProxy.cs
- PrintPreviewControl.cs
- input.cs
- LambdaCompiler.Binary.cs
- UnhandledExceptionEventArgs.cs
- DoubleAnimationUsingPath.cs
- ResourcesGenerator.cs
- BitmapCache.cs
- LayeredChannelListener.cs
- RC2CryptoServiceProvider.cs
- FamilyTypefaceCollection.cs
- LoaderAllocator.cs
- GroupBoxAutomationPeer.cs
- DotExpr.cs
- PreProcessor.cs
- AspNetSynchronizationContext.cs
- bindurihelper.cs
- ConcurrentDictionary.cs
- DispatcherOperation.cs
- _ProxyChain.cs
- EntityViewGenerationAttribute.cs
- TraceContext.cs
- URLIdentityPermission.cs
- DataStorage.cs
- SendContent.cs
- DescendentsWalker.cs
- MessageDesigner.cs
- SaveLedgerEntryRequest.cs
- CreateUserWizardStep.cs
- BufferedGraphicsContext.cs
- StorageConditionPropertyMapping.cs
- Margins.cs
- SqlAliasesReferenced.cs
- ListSortDescriptionCollection.cs
- AnimationTimeline.cs
- CompatibleComparer.cs
- CookieHandler.cs
- ListInitExpression.cs
- WorkflowOwnerAsyncResult.cs
- ComponentDispatcher.cs
- EditingCommands.cs
- CheckBoxBaseAdapter.cs
- ChangeInterceptorAttribute.cs
- RestClientProxyHandler.cs
- ValidationError.cs
- SQLGuid.cs
- FixedSOMContainer.cs
- PageCopyCount.cs
- DataGridViewCellMouseEventArgs.cs
- InfiniteIntConverter.cs
- XamlWriter.cs
- CodeTypeReferenceExpression.cs
- AppSettingsReader.cs
- TextRunTypographyProperties.cs
- InputMethod.cs
- BlurBitmapEffect.cs
- DataRowChangeEvent.cs
- HttpGetProtocolImporter.cs
- TemplateParser.cs
- TextFormatter.cs
- ComboBoxRenderer.cs
- ApplicationServicesHostFactory.cs
- TemplateLookupAction.cs
- GenericsNotImplementedException.cs
- WebBrowserDocumentCompletedEventHandler.cs
- AccessDataSource.cs
- TabletCollection.cs
- log.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- AutomationPropertyInfo.cs
- RotateTransform3D.cs
- QueuePathDialog.cs
- Delegate.cs
- CodeTypeDeclaration.cs
- BrushConverter.cs
- EntityDataSourceSelectedEventArgs.cs
- PolygonHotSpot.cs
- DesignerVerb.cs
- SqlDependencyListener.cs
- DataGridViewCellEventArgs.cs
- Help.cs
- RequestUriProcessor.cs
- XamlBuildTaskServices.cs
- WebBrowserEvent.cs
- DataRelationCollection.cs
- TargetParameterCountException.cs
- PreparingEnlistment.cs
- Odbc32.cs
- DesignUtil.cs
- RewritingSimplifier.cs
- Substitution.cs
- RuleAction.cs
- MemoryFailPoint.cs
- TransportationConfigurationTypeInstallComponent.cs
- VirtualPath.cs
- PropertyManager.cs