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
- EmptyWorkItem.cs
- ConfigurationPermission.cs
- MenuItem.cs
- ColorConvertedBitmap.cs
- _SingleItemRequestCache.cs
- DrawingAttributeSerializer.cs
- ToolStripItem.cs
- DataGridViewLayoutData.cs
- Throw.cs
- Condition.cs
- DetailsViewModeEventArgs.cs
- XmlSchemaComplexContentExtension.cs
- WSDualHttpBinding.cs
- ParallelRangeManager.cs
- LocalFileSettingsProvider.cs
- KnownBoxes.cs
- InputProviderSite.cs
- PolicyManager.cs
- GridViewAutoFormat.cs
- XmlWriterSettings.cs
- DrawingVisual.cs
- SkinBuilder.cs
- TextTreeTextNode.cs
- MsmqIntegrationBindingElement.cs
- BitmapCacheBrush.cs
- FormView.cs
- DomainUpDown.cs
- DataGridPageChangedEventArgs.cs
- TablePatternIdentifiers.cs
- CompModSwitches.cs
- DateTimeFormat.cs
- _Semaphore.cs
- ResourcePermissionBaseEntry.cs
- FilteredReadOnlyMetadataCollection.cs
- Error.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XmlSchemaGroupRef.cs
- ReferentialConstraint.cs
- Content.cs
- WizardStepBase.cs
- NativeWindow.cs
- CustomValidator.cs
- CodeConditionStatement.cs
- PagesSection.cs
- JsonFaultDetail.cs
- fixedPageContentExtractor.cs
- XmlReflectionMember.cs
- SafeProcessHandle.cs
- QueryInterceptorAttribute.cs
- ObjectViewEntityCollectionData.cs
- XPathDocumentNavigator.cs
- SecurityElement.cs
- ExtensionsSection.cs
- CompositionAdorner.cs
- SecurityUtils.cs
- SmtpException.cs
- SctClaimDictionary.cs
- QueryOutputWriter.cs
- TextDecorationCollectionConverter.cs
- EdmItemError.cs
- codemethodreferenceexpression.cs
- querybuilder.cs
- Vector3DCollection.cs
- DataGridParentRows.cs
- TempFiles.cs
- EventSetterHandlerConverter.cs
- AttachedAnnotation.cs
- SrgsToken.cs
- SystemIcmpV6Statistics.cs
- MustUnderstandSoapException.cs
- Popup.cs
- Light.cs
- SecurityResources.cs
- SponsorHelper.cs
- WindowsSolidBrush.cs
- Not.cs
- RijndaelManagedTransform.cs
- CustomWebEventKey.cs
- SiteMapDataSource.cs
- EntityProviderServices.cs
- XmlSortKey.cs
- VariableQuery.cs
- HtmlCommandAdapter.cs
- PropertyChangedEventArgs.cs
- SpecialFolderEnumConverter.cs
- PropertyEntry.cs
- OdbcDataReader.cs
- GenericIdentity.cs
- DuplicateWaitObjectException.cs
- CompilerHelpers.cs
- SudsWriter.cs
- DeploymentExceptionMapper.cs
- ListView.cs
- Instrumentation.cs
- XamlSerializerUtil.cs
- ObjectStateFormatter.cs
- BorderSidesEditor.cs
- ValidationSummary.cs
- BitArray.cs
- FileLogRecordStream.cs