Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DLinq / Dlinq / SqlClient / Query / SqlGatherConsumedAliases.cs / 1 / 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
- TabPage.cs
- SqlTriggerAttribute.cs
- PeerMessageDispatcher.cs
- DiscoveryInnerClientAdhoc11.cs
- XamlGridLengthSerializer.cs
- MaskedTextBoxTextEditorDropDown.cs
- EventWaitHandleSecurity.cs
- SqlCommand.cs
- UnsignedPublishLicense.cs
- BatchServiceHost.cs
- BindingValueChangedEventArgs.cs
- WebPartAuthorizationEventArgs.cs
- DataColumnPropertyDescriptor.cs
- HttpBrowserCapabilitiesBase.cs
- SchemaCollectionCompiler.cs
- IntSecurity.cs
- LocalFileSettingsProvider.cs
- MexServiceChannelBuilder.cs
- ScrollProperties.cs
- SafeFileMapViewHandle.cs
- ItemCollection.cs
- ServiceHostFactory.cs
- ConversionHelper.cs
- DictionaryEntry.cs
- TrustLevel.cs
- ResourceDescriptionAttribute.cs
- DirectoryRootQuery.cs
- WebPartUserCapability.cs
- XmlHierarchicalEnumerable.cs
- PropVariant.cs
- StateMachineDesignerPaint.cs
- IndentedWriter.cs
- XmlSchemaException.cs
- SessionStateUtil.cs
- Size3D.cs
- PerformanceCounterNameAttribute.cs
- KeyedQueue.cs
- RuntimeIdentifierPropertyAttribute.cs
- UIPropertyMetadata.cs
- ReadingWritingEntityEventArgs.cs
- LineBreakRecord.cs
- ElementProxy.cs
- AttributeExtensions.cs
- PathFigureCollection.cs
- IndexOutOfRangeException.cs
- DataObjectSettingDataEventArgs.cs
- SectionXmlInfo.cs
- StringUtil.cs
- BooleanStorage.cs
- CompositeControl.cs
- NodeInfo.cs
- AnnouncementDispatcherAsyncResult.cs
- LambdaCompiler.Expressions.cs
- DriveNotFoundException.cs
- MailHeaderInfo.cs
- MenuItemCollection.cs
- SizeAnimation.cs
- NullableDoubleMinMaxAggregationOperator.cs
- TimerElapsedEvenArgs.cs
- XmlFileEditor.cs
- Attribute.cs
- UnmanagedMarshal.cs
- ContainerUIElement3D.cs
- EventMappingSettings.cs
- Assert.cs
- PackagingUtilities.cs
- ReaderWriterLock.cs
- ThreadSafeList.cs
- SqlDataSourceQueryConverter.cs
- ScriptModule.cs
- StatusBarAutomationPeer.cs
- XmlBoundElement.cs
- CreateUserWizardStep.cs
- FrugalMap.cs
- MetadataCacheItem.cs
- XmlSerializerObjectSerializer.cs
- DrawingGroupDrawingContext.cs
- ProviderConnectionPoint.cs
- StringComparer.cs
- ObjectRef.cs
- PermissionSetTriple.cs
- OdbcConnectionHandle.cs
- ServiceOperationInfoTypeConverter.cs
- MaskDescriptors.cs
- WindowsListViewGroup.cs
- PageThemeParser.cs
- XmlDomTextWriter.cs
- SmtpDigestAuthenticationModule.cs
- SchemaMapping.cs
- BufferBuilder.cs
- InvokeMethodActivity.cs
- Part.cs
- RemotingHelper.cs
- HostProtectionException.cs
- RootBrowserWindowProxy.cs
- SelectionHighlightInfo.cs
- AudioException.cs
- BoundColumn.cs
- XmlILTrace.cs
- SchemaEntity.cs