Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DLinq / Dlinq / SqlClient / Query / SqlGatherConsumedAliases.cs / 1305376 / SqlGatherConsumedAliases.cs
using System; using System.Collections.Generic; using System.Text; namespace System.Data.Linq.SqlClient { ////// Walk a tree and return the set of unique aliases it consumes. /// class SqlGatherConsumedAliases { internal static HashSetGather(SqlNode node) { Gatherer g = new Gatherer(); g.Visit(node); return g.Consumed; } private class Gatherer : SqlVisitor { internal HashSet Consumed = new HashSet (); internal void VisitAliasConsumed(SqlAlias a) { Consumed.Add(a); } internal override SqlExpression VisitColumn(SqlColumn col) { VisitAliasConsumed(col.Alias); VisitExpression(col.Expression); return col; } internal override SqlExpression VisitColumnRef(SqlColumnRef cref) { VisitAliasConsumed(cref.Column.Alias); return cref; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Text; namespace System.Data.Linq.SqlClient { /// /// Walk a tree and return the set of unique aliases it consumes. /// class SqlGatherConsumedAliases { internal static HashSetGather(SqlNode node) { Gatherer g = new Gatherer(); g.Visit(node); return g.Consumed; } private class Gatherer : SqlVisitor { internal HashSet Consumed = new HashSet (); internal void VisitAliasConsumed(SqlAlias a) { Consumed.Add(a); } internal override SqlExpression VisitColumn(SqlColumn col) { VisitAliasConsumed(col.Alias); VisitExpression(col.Expression); return col; } internal override SqlExpression VisitColumnRef(SqlColumnRef cref) { VisitAliasConsumed(cref.Column.Alias); return cref; } } } } // 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
- WorkflowPageSetupDialog.cs
- WebPermission.cs
- QueryContext.cs
- DataShape.cs
- HttpCacheParams.cs
- KeyFrames.cs
- CustomError.cs
- SQLDouble.cs
- ViewManager.cs
- DataSourceConverter.cs
- MergePropertyDescriptor.cs
- mda.cs
- NativeMethods.cs
- OdbcConnectionHandle.cs
- EntityViewGenerationConstants.cs
- FileIOPermission.cs
- Canvas.cs
- XmlValueConverter.cs
- Automation.cs
- UnionQueryOperator.cs
- PolicyStatement.cs
- XmlSchemaImporter.cs
- HScrollBar.cs
- unsafenativemethodsother.cs
- ManagementObjectCollection.cs
- recordstatescratchpad.cs
- KeySplineConverter.cs
- SelectionList.cs
- SurrogateSelector.cs
- LinqDataSourceDeleteEventArgs.cs
- FileDialog_Vista_Interop.cs
- HwndAppCommandInputProvider.cs
- ReadWriteSpinLock.cs
- LogicalTreeHelper.cs
- HtmlInputControl.cs
- ClientCultureInfo.cs
- XhtmlBasicImageAdapter.cs
- XmlSerializerFactory.cs
- NameScope.cs
- BordersPage.cs
- ReliabilityContractAttribute.cs
- ExpressionNormalizer.cs
- QuaternionAnimationUsingKeyFrames.cs
- NotConverter.cs
- BitmapEffect.cs
- AvTraceDetails.cs
- DataGridTableCollection.cs
- WindowsNonControl.cs
- JavascriptXmlWriterWrapper.cs
- ToolStripContainer.cs
- ContextMenu.cs
- SQLDateTimeStorage.cs
- TagPrefixCollection.cs
- _DigestClient.cs
- DataGridSortCommandEventArgs.cs
- QilPatternFactory.cs
- SqlDataSourceCache.cs
- OracleConnection.cs
- GridViewPageEventArgs.cs
- SystemDiagnosticsSection.cs
- DecoderReplacementFallback.cs
- WebPartDisplayModeEventArgs.cs
- ServicePointManagerElement.cs
- DeadCharTextComposition.cs
- sqlstateclientmanager.cs
- SafeTimerHandle.cs
- ContextStaticAttribute.cs
- DescriptionAttribute.cs
- UriScheme.cs
- Column.cs
- PolyQuadraticBezierSegment.cs
- EventHandlersDesigner.cs
- SimpleWorkerRequest.cs
- CodeSubDirectory.cs
- UIntPtr.cs
- MulticastOption.cs
- ArgumentOutOfRangeException.cs
- PrimitiveType.cs
- TransformPattern.cs
- StringReader.cs
- InputBuffer.cs
- PropertyStore.cs
- RectangleGeometry.cs
- FieldNameLookup.cs
- FtpRequestCacheValidator.cs
- CancellationState.cs
- ConfigsHelper.cs
- StorageRoot.cs
- DragDeltaEventArgs.cs
- UIElementCollection.cs
- ExceptionHandler.cs
- SortedDictionary.cs
- InheritanceRules.cs
- MissingManifestResourceException.cs
- BasicCommandTreeVisitor.cs
- ApplicationManager.cs
- TouchDevice.cs
- WebServiceTypeData.cs
- GraphicsContext.cs
- Accessors.cs