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
- WebControlsSection.cs
- IgnoreFileBuildProvider.cs
- ContextStaticAttribute.cs
- TerminatorSinks.cs
- Scheduler.cs
- DtdParser.cs
- ApplicationActivator.cs
- HttpProfileBase.cs
- SplitterCancelEvent.cs
- XPathNodeList.cs
- DocumentGridContextMenu.cs
- ReaderWriterLockSlim.cs
- UMPAttributes.cs
- InputMethod.cs
- IfJoinedCondition.cs
- Vector3DAnimationBase.cs
- RubberbandSelector.cs
- HttpListenerContext.cs
- PenContexts.cs
- KeyValueConfigurationCollection.cs
- SizeChangedEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- WindowsListViewItem.cs
- MatrixTransform.cs
- IISMapPath.cs
- InfoCardSymmetricAlgorithm.cs
- GenericAuthenticationEventArgs.cs
- FacetDescriptionElement.cs
- Visitors.cs
- CmsUtils.cs
- HtmlInputHidden.cs
- CopyAction.cs
- PackWebRequest.cs
- AnonymousIdentificationSection.cs
- CalendarDay.cs
- XmlUtil.cs
- MSAAWinEventWrap.cs
- FrameworkTemplate.cs
- QuaternionAnimation.cs
- COM2ComponentEditor.cs
- ResizeGrip.cs
- RecordBuilder.cs
- DbProviderFactoriesConfigurationHandler.cs
- GeneratedView.cs
- BitmapEffectInputConnector.cs
- EmptyEnumerator.cs
- ExtendedProperty.cs
- ImageSourceConverter.cs
- ConnectionAcceptor.cs
- TraceUtility.cs
- _SingleItemRequestCache.cs
- BitmapEffectDrawingContextWalker.cs
- PeerNameRecord.cs
- ListViewGroup.cs
- DataSourceControl.cs
- RolePrincipal.cs
- Trigger.cs
- RuntimeResourceSet.cs
- BindingSource.cs
- BrowserCapabilitiesCodeGenerator.cs
- AggregateNode.cs
- LogSwitch.cs
- PageBuildProvider.cs
- SQLDecimal.cs
- ColorTransformHelper.cs
- ServiceHttpModule.cs
- UIElementIsland.cs
- HwndStylusInputProvider.cs
- TypeUsage.cs
- HotSpot.cs
- ProcessThreadCollection.cs
- ZoneLinkButton.cs
- CustomAttributeBuilder.cs
- WindowsAltTab.cs
- DbConnectionStringCommon.cs
- SerializationUtility.cs
- CqlLexerHelpers.cs
- CfgParser.cs
- Clause.cs
- DataServiceRequest.cs
- GPPOINTF.cs
- coordinatorfactory.cs
- SimplePropertyEntry.cs
- ProfileParameter.cs
- DockingAttribute.cs
- ObjectDataProvider.cs
- TriggerBase.cs
- ProjectionPruner.cs
- EmbeddedMailObject.cs
- ValidatingCollection.cs
- OleDbError.cs
- SapiAttributeParser.cs
- SendKeys.cs
- DataErrorValidationRule.cs
- EventArgs.cs
- CredentialCache.cs
- ComponentEditorPage.cs
- AccessText.cs
- TraceListeners.cs
- ErrorRuntimeConfig.cs