Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DLinq / Dlinq / SqlClient / Query / SqlGatherConsumedAliases.cs / 2 / 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.
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
- WindowsSolidBrush.cs
- EnumType.cs
- XPathNodeHelper.cs
- XmlElementList.cs
- ColorContextHelper.cs
- HandlerBase.cs
- NavigateEvent.cs
- ListCollectionView.cs
- OdbcCommandBuilder.cs
- RemoteWebConfigurationHostStream.cs
- ContentDesigner.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- DtdParser.cs
- Decimal.cs
- ExpressionWriter.cs
- isolationinterop.cs
- NetSectionGroup.cs
- TdsParser.cs
- MessageBox.cs
- TreeNode.cs
- DataQuery.cs
- AspNetCompatibilityRequirementsAttribute.cs
- LinqTreeNodeEvaluator.cs
- Panel.cs
- PrincipalPermission.cs
- PageVisual.cs
- PreservationFileWriter.cs
- FilterQuery.cs
- InternalControlCollection.cs
- Cursor.cs
- EdmScalarPropertyAttribute.cs
- FieldDescriptor.cs
- EpmCustomContentSerializer.cs
- ConnectionPoint.cs
- HttpListenerElement.cs
- securitycriticaldataformultiplegetandset.cs
- ProxyElement.cs
- DesignOnlyAttribute.cs
- GenericWebPart.cs
- DataViewManager.cs
- Properties.cs
- BinarySerializer.cs
- ClientTargetSection.cs
- Paragraph.cs
- ImageMetadata.cs
- InternalConfigEventArgs.cs
- DateTimeValueSerializer.cs
- Repeater.cs
- BypassElement.cs
- EventSourceCreationData.cs
- SimpleWebHandlerParser.cs
- XmlSchemaInfo.cs
- ControlCollection.cs
- MembershipSection.cs
- PropertyInfoSet.cs
- ReadOnlyAttribute.cs
- ItemContainerGenerator.cs
- CacheOutputQuery.cs
- Brush.cs
- PrintDialogDesigner.cs
- PcmConverter.cs
- ServiceDescriptionReflector.cs
- MonthChangedEventArgs.cs
- XhtmlConformanceSection.cs
- TileBrush.cs
- XsltInput.cs
- NoneExcludedImageIndexConverter.cs
- RectValueSerializer.cs
- SoapObjectReader.cs
- QueryTaskGroupState.cs
- ToolStripRenderEventArgs.cs
- EventHandlersStore.cs
- XLinq.cs
- ConfigurationException.cs
- TableItemStyle.cs
- DataControlButton.cs
- Window.cs
- HtmlTextArea.cs
- ButtonField.cs
- MatrixTransform3D.cs
- RequestCachingSection.cs
- CharUnicodeInfo.cs
- MessageParameterAttribute.cs
- DataGridAutomationPeer.cs
- DateTimeOffsetAdapter.cs
- WSHttpSecurity.cs
- BitmapEncoder.cs
- HandleCollector.cs
- Calendar.cs
- DrawingGroupDrawingContext.cs
- ProcessHostMapPath.cs
- QilFunction.cs
- LocatorBase.cs
- DeleteHelper.cs
- HostingEnvironment.cs
- ContainerActivationHelper.cs
- TableLayoutPanelCellPosition.cs
- SortedDictionary.cs
- NullPackagingPolicy.cs
- IOThreadTimer.cs