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
- XmlReader.cs
- HttpCachePolicyWrapper.cs
- InvalidCastException.cs
- DependencyObjectProvider.cs
- XslAst.cs
- EventRouteFactory.cs
- ReversePositionQuery.cs
- SendingRequestEventArgs.cs
- ColumnResizeUndoUnit.cs
- DSACryptoServiceProvider.cs
- SurrogateDataContract.cs
- CodeMemberEvent.cs
- WindowsFormsLinkLabel.cs
- TabRenderer.cs
- DecimalConstantAttribute.cs
- DynamicResourceExtensionConverter.cs
- WebPageTraceListener.cs
- LoginCancelEventArgs.cs
- CompilationRelaxations.cs
- DeploymentSection.cs
- ColorTranslator.cs
- TreeNodeCollection.cs
- DiscreteKeyFrames.cs
- ELinqQueryState.cs
- TimerEventSubscription.cs
- Privilege.cs
- ServiceBuildProvider.cs
- Preprocessor.cs
- ExpandCollapseProviderWrapper.cs
- LambdaReference.cs
- EventEntry.cs
- Byte.cs
- ServiceDescriptions.cs
- activationcontext.cs
- ConfigurationStrings.cs
- ClientConvert.cs
- HttpModuleAction.cs
- ResourceReferenceKeyNotFoundException.cs
- NavigateEvent.cs
- HtmlInputRadioButton.cs
- ConfigurationValidatorBase.cs
- ZipIOExtraFieldPaddingElement.cs
- SoapInteropTypes.cs
- PolyBezierSegment.cs
- JpegBitmapDecoder.cs
- SqlDataSourceEnumerator.cs
- SByteConverter.cs
- XPathNodeList.cs
- AttributeData.cs
- CodeTypeOfExpression.cs
- WindowsGraphicsWrapper.cs
- SchemaObjectWriter.cs
- UriTemplateLiteralQueryValue.cs
- ConditionCollection.cs
- Span.cs
- RtfToXamlLexer.cs
- ReadContentAsBinaryHelper.cs
- VectorKeyFrameCollection.cs
- TextShapeableCharacters.cs
- UIElementPropertyUndoUnit.cs
- TableSectionStyle.cs
- FolderBrowserDialogDesigner.cs
- SimpleWorkerRequest.cs
- ContainerUtilities.cs
- DataGridComponentEditor.cs
- Membership.cs
- TraceHandler.cs
- UniqueID.cs
- DescriptionAttribute.cs
- UserControlParser.cs
- BindUriHelper.cs
- WebPartZone.cs
- TextInfo.cs
- MsmqBindingFilter.cs
- ObjectDataSourceFilteringEventArgs.cs
- LogicalTreeHelper.cs
- followingsibling.cs
- Point3DValueSerializer.cs
- GroupItem.cs
- TextProperties.cs
- FileAuthorizationModule.cs
- GradientPanel.cs
- RSAPKCS1SignatureDeformatter.cs
- shaperfactoryquerycachekey.cs
- SQLSingleStorage.cs
- PriorityQueue.cs
- AmbientEnvironment.cs
- ByteFacetDescriptionElement.cs
- BuildProvider.cs
- GradientStop.cs
- CreateUserWizardAutoFormat.cs
- IndexedWhereQueryOperator.cs
- Misc.cs
- SignatureToken.cs
- Speller.cs
- WebPartTransformerCollection.cs
- CharacterMetricsDictionary.cs
- CqlBlock.cs
- HMACSHA512.cs
- TabControlAutomationPeer.cs