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
- Socket.cs
- FileSystemEventArgs.cs
- Italic.cs
- SqlCaseSimplifier.cs
- X509ClientCertificateAuthenticationElement.cs
- HttpClientCertificate.cs
- DrawingBrush.cs
- DbConnectionFactory.cs
- ToolStripGrip.cs
- ProvidePropertyAttribute.cs
- Tuple.cs
- BooleanExpr.cs
- FrameworkRichTextComposition.cs
- Path.cs
- ServiceCredentials.cs
- Msec.cs
- Drawing.cs
- SemanticResolver.cs
- WebEvents.cs
- FileRegion.cs
- NullableConverter.cs
- RuntimeCompatibilityAttribute.cs
- DropShadowBitmapEffect.cs
- DesignerView.cs
- PolyBezierSegmentFigureLogic.cs
- ElementNotEnabledException.cs
- EdmProperty.cs
- RectIndependentAnimationStorage.cs
- ParenExpr.cs
- ComplexBindingPropertiesAttribute.cs
- SecurityHelper.cs
- EntityDataSourceEntityTypeFilterItem.cs
- Timer.cs
- DataContext.cs
- WebBrowserUriTypeConverter.cs
- GridErrorDlg.cs
- QilScopedVisitor.cs
- GraphicsPath.cs
- SourceLocation.cs
- Comparer.cs
- ModelChangedEventArgsImpl.cs
- DictionaryBase.cs
- HttpResponseInternalWrapper.cs
- DropShadowBitmapEffect.cs
- GenericAuthenticationEventArgs.cs
- ColumnHeaderConverter.cs
- unsafenativemethodstextservices.cs
- Calendar.cs
- PtsHelper.cs
- GroupBoxAutomationPeer.cs
- XPathException.cs
- AttributeData.cs
- SamlNameIdentifierClaimResource.cs
- ConstNode.cs
- SmtpReplyReaderFactory.cs
- XmlSchemaAll.cs
- PageAction.cs
- SAPICategories.cs
- SmtpMail.cs
- GC.cs
- TableItemProviderWrapper.cs
- Queue.cs
- TreeNodeBindingCollection.cs
- List.cs
- NetDispatcherFaultException.cs
- UniqueEventHelper.cs
- Point3DAnimationBase.cs
- QueryResponse.cs
- FloatAverageAggregationOperator.cs
- UnsafeNativeMethods.cs
- _ScatterGatherBuffers.cs
- Helpers.cs
- processwaithandle.cs
- MenuScrollingVisibilityConverter.cs
- AVElementHelper.cs
- SafeCoTaskMem.cs
- ProfileProvider.cs
- SoapHeaders.cs
- UIElementAutomationPeer.cs
- DocumentOutline.cs
- DbConnectionClosed.cs
- XmlSerializationWriter.cs
- VisualCollection.cs
- UInt32Storage.cs
- ByteFacetDescriptionElement.cs
- ZipIOLocalFileHeader.cs
- Quaternion.cs
- ToolBarTray.cs
- StrokeNode.cs
- UnsafeMethods.cs
- WebExceptionStatus.cs
- MobileTemplatedControlDesigner.cs
- CopyNodeSetAction.cs
- DataPagerCommandEventArgs.cs
- xamlnodes.cs
- EntityModelBuildProvider.cs
- ObjectDisposedException.cs
- PropertyDescriptorCollection.cs
- BuilderPropertyEntry.cs
- GenericUriParser.cs