Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / NewXml / TreeIterator.cs / 1305376 / TreeIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- #pragma warning disable 618 // ignore obsolete warning about XmlDataDocument namespace System.Xml { 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CqlErrorHelper.cs
- ObjectAssociationEndMapping.cs
- NewArrayExpression.cs
- OutputCacheProfile.cs
- Typography.cs
- Vector3dCollection.cs
- InvalidFilterCriteriaException.cs
- X509CertificateCollection.cs
- WmlLinkAdapter.cs
- AuthenticationSection.cs
- DataColumnPropertyDescriptor.cs
- SemaphoreFullException.cs
- ObfuscationAttribute.cs
- Deserializer.cs
- DataGridCaption.cs
- DelimitedListTraceListener.cs
- EntityDesignerUtils.cs
- PingOptions.cs
- StrokeNodeData.cs
- MbpInfo.cs
- WindowsFont.cs
- NamespaceQuery.cs
- BitmapFrame.cs
- OraclePermissionAttribute.cs
- SynchronizationHandlesCodeDomSerializer.cs
- DataGridViewColumnCollectionEditor.cs
- WebPartMenu.cs
- CreateUserWizardStep.cs
- PropertyValueUIItem.cs
- StrongNameKeyPair.cs
- HttpCapabilitiesBase.cs
- SafeHandle.cs
- SchemaElementLookUpTable.cs
- InsufficientMemoryException.cs
- RadioButtonList.cs
- ResourceContainer.cs
- CachedPathData.cs
- DbConnectionStringBuilder.cs
- SourceFileInfo.cs
- Label.cs
- SpellerError.cs
- PropertyDescriptor.cs
- WorkflowInspectionServices.cs
- Nodes.cs
- MarkupCompilePass2.cs
- GridView.cs
- WindowsToolbarItemAsMenuItem.cs
- RemotingException.cs
- Brushes.cs
- PropertyPathConverter.cs
- HitTestDrawingContextWalker.cs
- XmlStreamStore.cs
- WhiteSpaceTrimStringConverter.cs
- IDReferencePropertyAttribute.cs
- MetadataSource.cs
- ScriptResourceDefinition.cs
- ObjectAssociationEndMapping.cs
- LassoHelper.cs
- SqlBulkCopy.cs
- XmlNavigatorStack.cs
- PersonalizationDictionary.cs
- XmlILOptimizerVisitor.cs
- VariantWrapper.cs
- ImageIndexConverter.cs
- SafeNativeMethods.cs
- ArrayItemReference.cs
- HierarchicalDataBoundControl.cs
- FormViewCommandEventArgs.cs
- TimeoutException.cs
- SqlComparer.cs
- LinqDataSourceHelper.cs
- IntSecurity.cs
- __Filters.cs
- XmlHierarchicalEnumerable.cs
- RSAOAEPKeyExchangeFormatter.cs
- Sql8ExpressionRewriter.cs
- DictionaryKeyPropertyAttribute.cs
- Transform.cs
- securestring.cs
- FileSystemEnumerable.cs
- SqlDelegatedTransaction.cs
- Decoder.cs
- AudienceUriMode.cs
- File.cs
- DataSetSchema.cs
- KnownTypesProvider.cs
- DoubleIndependentAnimationStorage.cs
- TraceRecords.cs
- ObjectParameter.cs
- DescendantOverDescendantQuery.cs
- And.cs
- TextAdaptor.cs
- ToolStripItemCollection.cs
- Buffer.cs
- SqlClientWrapperSmiStreamChars.cs
- BitmapEffectGroup.cs
- TableCell.cs
- GlobalizationSection.cs
- ZoneIdentityPermission.cs
- ResourceExpressionBuilder.cs