Code:
/ 4.0 / 4.0 / untmp / 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 HashSet Gather(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
- TreeNodeClickEventArgs.cs
- BuildResult.cs
- EntityContainerRelationshipSetEnd.cs
- Label.cs
- XmlSchemaDatatype.cs
- EventLogEntryCollection.cs
- DataContractJsonSerializer.cs
- BlurEffect.cs
- IDispatchConstantAttribute.cs
- TabControl.cs
- FillBehavior.cs
- ICollection.cs
- SecurityContext.cs
- SerialReceived.cs
- EntityViewGenerationAttribute.cs
- Filter.cs
- MessageContractImporter.cs
- ToolStripRendererSwitcher.cs
- Span.cs
- MessageBox.cs
- UIElementPropertyUndoUnit.cs
- XAMLParseException.cs
- DataGridViewHeaderCell.cs
- BindStream.cs
- DispatcherExceptionFilterEventArgs.cs
- WindowInteropHelper.cs
- WebPartTransformer.cs
- CacheMemory.cs
- WmlTextViewAdapter.cs
- DoubleCollectionConverter.cs
- ObjectStateFormatter.cs
- BindValidator.cs
- OdbcTransaction.cs
- WindowsRichEdit.cs
- DataGridViewButtonColumn.cs
- PrePrepareMethodAttribute.cs
- Single.cs
- CancellationHandler.cs
- Input.cs
- WebAdminConfigurationHelper.cs
- MetadataArtifactLoaderResource.cs
- MenuItemBindingCollection.cs
- WebBrowsableAttribute.cs
- IFormattable.cs
- OperationParameterInfo.cs
- DesignerSerializationOptionsAttribute.cs
- HtmlControlPersistable.cs
- ValueUtilsSmi.cs
- TextReturnReader.cs
- ASCIIEncoding.cs
- CodeTypeDeclaration.cs
- ChannelManager.cs
- XmlSchemaExternal.cs
- _NetworkingPerfCounters.cs
- ColumnMapCopier.cs
- Propagator.ExtentPlaceholderCreator.cs
- Site.cs
- BookmarkScopeManager.cs
- CatalogZoneBase.cs
- Atom10FormatterFactory.cs
- SystemIcmpV4Statistics.cs
- AssemblyAttributesGoHere.cs
- MiniModule.cs
- ByteStack.cs
- BindingBase.cs
- ApplicationProxyInternal.cs
- RelationshipWrapper.cs
- DescendantQuery.cs
- ConnectionStringSettingsCollection.cs
- XmlSchemaAnnotation.cs
- ExpandSegment.cs
- MessageBox.cs
- SiteMapPathDesigner.cs
- ArgumentOutOfRangeException.cs
- HeaderedItemsControl.cs
- HierarchicalDataBoundControl.cs
- ReaderWriterLockWrapper.cs
- TextEditorMouse.cs
- WhitespaceSignificantCollectionAttribute.cs
- PassportAuthenticationEventArgs.cs
- Clause.cs
- ContentPosition.cs
- WindowsEditBoxRange.cs
- DeclaredTypeElement.cs
- TypeElement.cs
- LinqDataSource.cs
- XsltFunctions.cs
- LayoutDump.cs
- GridViewRow.cs
- MetadataHelper.cs
- NotifyInputEventArgs.cs
- CustomErrorsSectionWrapper.cs
- ConfigurationManagerInternalFactory.cs
- ComponentResourceKey.cs
- NameValueFileSectionHandler.cs
- CultureInfoConverter.cs
- SQLBoolean.cs
- FontCacheUtil.cs
- GridItemPatternIdentifiers.cs
- FileDialogCustomPlacesCollection.cs