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
- DeferrableContentConverter.cs
- AggregateNode.cs
- GPPOINTF.cs
- ConfigurationHelpers.cs
- StreamingContext.cs
- TableRowGroupCollection.cs
- SeverityFilter.cs
- HMACMD5.cs
- ContextProperty.cs
- NativeMethods.cs
- MultiSelectRootGridEntry.cs
- RelationshipType.cs
- SurrogateChar.cs
- XmlTypeAttribute.cs
- ProjectionPlan.cs
- AssemblyBuilder.cs
- Brush.cs
- WpfKnownTypeInvoker.cs
- XmlChoiceIdentifierAttribute.cs
- TimerElapsedEvenArgs.cs
- DefaultTraceListener.cs
- TypeFieldSchema.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- TaiwanLunisolarCalendar.cs
- DLinqColumnProvider.cs
- StandardTransformFactory.cs
- ButtonChrome.cs
- AssemblyCollection.cs
- ParallelDesigner.cs
- CodeArrayIndexerExpression.cs
- IdleTimeoutMonitor.cs
- XslNumber.cs
- ClientType.cs
- ComponentConverter.cs
- TraceContextEventArgs.cs
- DXD.cs
- AsynchronousChannelMergeEnumerator.cs
- SQLDecimal.cs
- XamlParser.cs
- BrowserDefinitionCollection.cs
- SqlUtils.cs
- MemberInfoSerializationHolder.cs
- PermissionSetTriple.cs
- DataGridItemCollection.cs
- BindingExpression.cs
- HwndSubclass.cs
- ResXResourceSet.cs
- ResizeGrip.cs
- ReaderContextStackData.cs
- DeflateStream.cs
- ComEventsHelper.cs
- X509SubjectKeyIdentifierClause.cs
- PathFigureCollection.cs
- NativeRightsManagementAPIsStructures.cs
- TextEndOfParagraph.cs
- SqlDataSourceEnumerator.cs
- DataMemberConverter.cs
- DataContractSerializer.cs
- SignedInfo.cs
- DataGridBoolColumn.cs
- FormsAuthenticationCredentials.cs
- OlePropertyStructs.cs
- ContentFileHelper.cs
- SimpleHandlerFactory.cs
- View.cs
- SafeArrayTypeMismatchException.cs
- ByteKeyFrameCollection.cs
- SqlDataSourceCache.cs
- RolePrincipal.cs
- IntegerValidator.cs
- PeerNameResolver.cs
- StateRuntime.cs
- TdsParser.cs
- HtmlTableRow.cs
- MiniMapControl.xaml.cs
- XmlSignificantWhitespace.cs
- ServiceElement.cs
- QueryInterceptorAttribute.cs
- Run.cs
- TransactionOptions.cs
- WebPartsSection.cs
- ListSourceHelper.cs
- BinarySerializer.cs
- RectangleF.cs
- DateTimeUtil.cs
- RemotingAttributes.cs
- SelectionItemPattern.cs
- SettingsContext.cs
- ImageBrush.cs
- HttpConfigurationSystem.cs
- DynamicPropertyReader.cs
- PartialClassGenerationTask.cs
- ParameterModifier.cs
- ContractMethodParameterInfo.cs
- ServiceChannel.cs
- WindowsSolidBrush.cs
- JsonReaderDelegator.cs
- ServiceObjectContainer.cs
- SafeSystemMetrics.cs
- MouseButton.cs