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
- Point4D.cs
- Emitter.cs
- LinqDataSourceUpdateEventArgs.cs
- DuplicateDetector.cs
- DodSequenceMerge.cs
- WebProxyScriptElement.cs
- SynchronizationLockException.cs
- MouseWheelEventArgs.cs
- MetadataArtifactLoaderFile.cs
- TypeResolver.cs
- XmlAtomicValue.cs
- ControlCommandSet.cs
- CollectionBuilder.cs
- ConfigurationValidatorBase.cs
- GetRecipientRequest.cs
- ProtocolViolationException.cs
- XPathDescendantIterator.cs
- PointLightBase.cs
- TimeSpan.cs
- WindowsFormsHost.cs
- QueryOutputWriter.cs
- SecurityTokenRequirement.cs
- FixedSOMElement.cs
- TypeValidationEventArgs.cs
- ObsoleteAttribute.cs
- DataGridHelper.cs
- OdbcConnectionString.cs
- CustomDictionarySources.cs
- CommandEventArgs.cs
- HostUtils.cs
- DbExpressionVisitor_TResultType.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- KeySplineConverter.cs
- ColorTypeConverter.cs
- TextEditorLists.cs
- SqlFunctions.cs
- AlternateViewCollection.cs
- LinkAreaEditor.cs
- ProfileGroupSettings.cs
- PreProcessor.cs
- DesignerForm.cs
- RuntimeResourceSet.cs
- TdsEnums.cs
- LinqDataSourceHelper.cs
- WindowAutomationPeer.cs
- DataSourceCacheDurationConverter.cs
- DataServiceExpressionVisitor.cs
- ProgressBarRenderer.cs
- ProfileBuildProvider.cs
- GenericEnumerator.cs
- PrinterUnitConvert.cs
- RawStylusInputCustomData.cs
- GlyphTypeface.cs
- LightweightCodeGenerator.cs
- ParameterElementCollection.cs
- PersonalizationEntry.cs
- shaper.cs
- TypeNameConverter.cs
- WebConvert.cs
- AuthenticationService.cs
- ExeConfigurationFileMap.cs
- GeometryModel3D.cs
- GetMemberBinder.cs
- PointValueSerializer.cs
- AutoSizeComboBox.cs
- TableLayoutSettingsTypeConverter.cs
- ChangeProcessor.cs
- OutputScopeManager.cs
- IPCCacheManager.cs
- ToolStripHighContrastRenderer.cs
- MethodBuilderInstantiation.cs
- SystemEvents.cs
- ToolboxDataAttribute.cs
- AsyncResult.cs
- MsmqHostedTransportConfiguration.cs
- DesignSurface.cs
- ConfigurationElement.cs
- CompositeActivityDesigner.cs
- HostAdapter.cs
- AttributeSetAction.cs
- RemoteDebugger.cs
- arabicshape.cs
- RegexWorker.cs
- StringCollection.cs
- ScaleTransform.cs
- TextElementAutomationPeer.cs
- NativeRightsManagementAPIsStructures.cs
- TypeDescriptor.cs
- TabPanel.cs
- RoutedEventConverter.cs
- DataGridRowEventArgs.cs
- _DisconnectOverlappedAsyncResult.cs
- EntityCommandExecutionException.cs
- ExpressionConverter.cs
- SecureStringHasher.cs
- VScrollProperties.cs
- ToggleButtonAutomationPeer.cs
- FileDataSourceCache.cs
- Triangle.cs
- FragmentQueryKB.cs