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
- ValidationEventArgs.cs
- DefaultParameterValueAttribute.cs
- FileDialog_Vista_Interop.cs
- CachedFontFamily.cs
- WindowsToolbarItemAsMenuItem.cs
- DataPointer.cs
- ToolStripItemRenderEventArgs.cs
- HandlerWithFactory.cs
- CollectionsUtil.cs
- CallbackHandler.cs
- Enum.cs
- XamlRtfConverter.cs
- PersonalizationProviderHelper.cs
- MarshalByRefObject.cs
- XmlCDATASection.cs
- RouteUrlExpressionBuilder.cs
- _LocalDataStore.cs
- RangeBaseAutomationPeer.cs
- UriExt.cs
- NullableIntMinMaxAggregationOperator.cs
- SignatureToken.cs
- KerberosRequestorSecurityToken.cs
- XmlDocumentFieldSchema.cs
- EmptyCollection.cs
- DesignerActionHeaderItem.cs
- KeyConstraint.cs
- XmlTextReaderImplHelpers.cs
- TypedTableBaseExtensions.cs
- Int32Storage.cs
- X509RawDataKeyIdentifierClause.cs
- SqlWorkflowInstanceStoreLock.cs
- HttpStreamXmlDictionaryReader.cs
- XmlSchemaElement.cs
- NavigatingCancelEventArgs.cs
- FlowDocumentPage.cs
- EpmSyndicationContentSerializer.cs
- WebEventTraceProvider.cs
- InkPresenterAutomationPeer.cs
- SynchronizedPool.cs
- PropertyBuilder.cs
- MarshalByValueComponent.cs
- RenderData.cs
- Bidi.cs
- MessageBox.cs
- PreProcessInputEventArgs.cs
- WebRequestModulesSection.cs
- IndexExpression.cs
- BitmapEffectOutputConnector.cs
- DataGridColumnCollection.cs
- PropertyIDSet.cs
- WebPartsSection.cs
- LineSegment.cs
- WebSysDefaultValueAttribute.cs
- DragCompletedEventArgs.cs
- SimpleNameService.cs
- TrackBar.cs
- SaveFileDialog.cs
- HttpMethodAttribute.cs
- StructuralComparisons.cs
- SingleAnimationUsingKeyFrames.cs
- XmlBindingWorker.cs
- COM2TypeInfoProcessor.cs
- SpnEndpointIdentityExtension.cs
- SelectedGridItemChangedEvent.cs
- TraceSource.cs
- PixelFormatConverter.cs
- ParameterBuilder.cs
- XmlSchemaException.cs
- MatrixCamera.cs
- TTSEngineProxy.cs
- TraceHandler.cs
- PeerNodeAddress.cs
- AutoGeneratedField.cs
- BoundColumn.cs
- ValidationHelper.cs
- WebEventTraceProvider.cs
- RenderTargetBitmap.cs
- Visual.cs
- TextServicesDisplayAttributePropertyRanges.cs
- DictionarySectionHandler.cs
- TextOptions.cs
- ToolStripItemClickedEventArgs.cs
- LinqDataSourceContextEventArgs.cs
- ErrorHandler.cs
- OleDbCommand.cs
- PriorityBinding.cs
- DirectionalLight.cs
- LinqDataSourceHelper.cs
- UInt32Converter.cs
- DrawingGroup.cs
- GridViewHeaderRowPresenter.cs
- ListenerConnectionModeReader.cs
- ClientScriptManager.cs
- ObsoleteAttribute.cs
- TileBrush.cs
- XmlSerializerAssemblyAttribute.cs
- ProtocolsConfigurationEntry.cs
- TextRenderer.cs
- DrawingCollection.cs
- ElementsClipboardData.cs