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
- PartitionerStatic.cs
- MetadataItem_Static.cs
- CodeTypeConstructor.cs
- HMACMD5.cs
- RoutedUICommand.cs
- GrammarBuilderPhrase.cs
- ApplicationManager.cs
- datacache.cs
- VariantWrapper.cs
- ListViewHitTestInfo.cs
- PropertyMapper.cs
- URLString.cs
- TreeViewItemAutomationPeer.cs
- ResourceExpressionEditor.cs
- ToolbarAUtomationPeer.cs
- TypeNameConverter.cs
- DbSetClause.cs
- PointConverter.cs
- EmissiveMaterial.cs
- XsdDataContractExporter.cs
- CngKeyBlobFormat.cs
- ArraySegment.cs
- ValidationErrorCollection.cs
- ImmComposition.cs
- EventLogQuery.cs
- DataColumnCollection.cs
- ContentControl.cs
- SettingsBindableAttribute.cs
- LinearGradientBrush.cs
- webbrowsersite.cs
- FrameworkObject.cs
- RowTypePropertyElement.cs
- HttpCacheParams.cs
- DataGridItemEventArgs.cs
- XslTransformFileEditor.cs
- IDictionary.cs
- path.cs
- TextBoxAutoCompleteSourceConverter.cs
- ReferenceSchema.cs
- SortableBindingList.cs
- DecimalFormatter.cs
- BindingBase.cs
- UrlMappingCollection.cs
- EntityCommandDefinition.cs
- InvalidAsynchronousStateException.cs
- ConnectionPool.cs
- Pen.cs
- TimerElapsedEvenArgs.cs
- ConversionContext.cs
- HitTestWithGeometryDrawingContextWalker.cs
- UnhandledExceptionEventArgs.cs
- __FastResourceComparer.cs
- SerializationInfo.cs
- BulletChrome.cs
- SerTrace.cs
- TypeExtension.cs
- XsltFunctions.cs
- CapabilitiesSection.cs
- HScrollProperties.cs
- HttpClientChannel.cs
- SectionXmlInfo.cs
- manifestimages.cs
- HtmlContainerControl.cs
- HttpConfigurationSystem.cs
- ScriptBehaviorDescriptor.cs
- DynamicDocumentPaginator.cs
- SessionStateModule.cs
- ObjectMemberMapping.cs
- BamlTreeMap.cs
- TableColumn.cs
- TraceSource.cs
- TextEditorDragDrop.cs
- GenericsNotImplementedException.cs
- ThreadExceptionEvent.cs
- ObjectComplexPropertyMapping.cs
- LinqDataSourceDeleteEventArgs.cs
- SizeConverter.cs
- PersistChildrenAttribute.cs
- ReadContentAsBinaryHelper.cs
- AddInDeploymentState.cs
- OutputCacheSettings.cs
- SqlDelegatedTransaction.cs
- DbMetaDataFactory.cs
- PerspectiveCamera.cs
- BindingWorker.cs
- TransactionScope.cs
- HMACSHA384.cs
- HtmlInputSubmit.cs
- CompilerGlobalScopeAttribute.cs
- TextRangeEditTables.cs
- CommentAction.cs
- QuaternionKeyFrameCollection.cs
- UTF8Encoding.cs
- InternalConfigHost.cs
- ApplicationFileParser.cs
- ResourceDefaultValueAttribute.cs
- BitmapEncoder.cs
- SqlParameterizer.cs
- AutomationPatternInfo.cs
- SoapRpcServiceAttribute.cs