Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Query / InternalTrees / NodeCounter.cs / 1305376 / NodeCounter.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; using System.Diagnostics; using System.Data.Common; using md=System.Data.Metadata.Edm; namespace System.Data.Query.InternalTrees { ////// Counts the number of nodes in a tree /// internal class NodeCounter : BasicOpVisitorOfT{ /// /// Public entry point - Calculates the nubmer of nodes in the given subTree /// /// ///internal static int Count(Node subTree) { NodeCounter counter = new NodeCounter(); return counter.VisitNode(subTree); } /// /// Common processing for all node types /// Count = 1 (self) + count of children /// /// ///protected override int VisitDefault(Node n) { int count = 1; foreach (Node child in n.Children) { count += VisitNode(child); } return count; } } } // 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
- SolidColorBrush.cs
- DynamicDocumentPaginator.cs
- BulletedList.cs
- MenuItemBindingCollection.cs
- Logging.cs
- DecoratedNameAttribute.cs
- AstNode.cs
- DeclaredTypeValidator.cs
- UnaryOperationBinder.cs
- XmlUtil.cs
- DbInsertCommandTree.cs
- BinHexEncoder.cs
- UnsafeNativeMethods.cs
- Descriptor.cs
- XmlUtf8RawTextWriter.cs
- AppDomainAttributes.cs
- SqlMethodAttribute.cs
- TreeViewCancelEvent.cs
- PixelFormats.cs
- StackSpiller.cs
- Util.cs
- glyphs.cs
- WebControl.cs
- COM2TypeInfoProcessor.cs
- TemplateBamlTreeBuilder.cs
- OdbcConnectionHandle.cs
- DesignTimeHTMLTextWriter.cs
- Interop.cs
- SizeF.cs
- WindowsListViewItemCheckBox.cs
- OracleCommandBuilder.cs
- ObjectConverter.cs
- SymbolMethod.cs
- WebPartVerb.cs
- PenContexts.cs
- DataGridParentRows.cs
- TraceHandler.cs
- EventItfInfo.cs
- RepeaterItem.cs
- ColumnWidthChangedEvent.cs
- TextRange.cs
- ToolStripRenderEventArgs.cs
- EntityDesignerBuildProvider.cs
- BypassElement.cs
- XmlCDATASection.cs
- EntityDataSourceState.cs
- XmlSchemaValidationException.cs
- ObjectHandle.cs
- SyntaxCheck.cs
- Matrix.cs
- RoutingService.cs
- StorageTypeMapping.cs
- RuleEngine.cs
- shaperfactoryquerycachekey.cs
- PerformanceCountersElement.cs
- clipboard.cs
- NavigationExpr.cs
- PageVisual.cs
- HitTestParameters3D.cs
- documentation.cs
- ColorBuilder.cs
- BaseDataList.cs
- ByteRangeDownloader.cs
- Dynamic.cs
- AtomServiceDocumentSerializer.cs
- ManipulationDeltaEventArgs.cs
- ScaleTransform3D.cs
- RegexCaptureCollection.cs
- ActivityExecutionContext.cs
- SqlBulkCopy.cs
- OlePropertyStructs.cs
- ReflectionTypeLoadException.cs
- XmlSchemaNotation.cs
- NavigationEventArgs.cs
- HttpApplication.cs
- NameValueConfigurationCollection.cs
- StorageConditionPropertyMapping.cs
- UpdateExpressionVisitor.cs
- PackageDigitalSignatureManager.cs
- SqlServer2KCompatibilityAnnotation.cs
- XmlSchemaDatatype.cs
- TemplatedAdorner.cs
- EntityCodeGenerator.cs
- TrackingProfileCache.cs
- PackageRelationship.cs
- ManagementObjectCollection.cs
- Error.cs
- RuntimeHandles.cs
- AnnotationAdorner.cs
- SliderAutomationPeer.cs
- CqlBlock.cs
- figurelength.cs
- NullReferenceException.cs
- controlskin.cs
- TcpTransportBindingElement.cs
- Point3D.cs
- XmlUnspecifiedAttribute.cs
- IgnoreSection.cs
- NativeMethods.cs
- BridgeDataRecord.cs