Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / MethodExpr.cs / 2 / MethodExpr.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backup [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Diagnostics; ////// represents a method/function/aggregate function/type constructor expression /// internal sealed class MethodExpr : Expr { private Expr _leftExpr; private Identifier _methodIdentifier; private DistinctKind _distinctKind; private ExprList_args; private string _internalAggregateName; private DbExpression _dummyExpression = null; private ExprList _relationships; /// /// initializes method ast node /// /// /// /// /// internal MethodExpr( Expr left, Identifier methodId, DistinctKind distinctKind, ExprListargs ) { _leftExpr = left; _methodIdentifier = methodId; _distinctKind = distinctKind; _args = args; } /// /// intializes a method ast node /// /// /// /// /// /// internal MethodExpr(Expr left, Identifier methodId, DistinctKind distinctKind, ExprListargs, ExprList relationships) { _leftExpr = left; _methodIdentifier = methodId; _distinctKind = distinctKind; _args = args; _relationships = relationships; } /// /// left expression /// internal Expr LeftExpr { get { return _leftExpr; } } ////// method identifier /// internal Identifier MethodIdentifier { get { return _methodIdentifier; } } ////// method name /// internal string MethodName { get { return MethodIdentifier.Name; } } ////// returns a dotexpr with the entire prefix /// internal DotExpr MethodPrefixExpr { get { return new DotExpr(LeftExpr, MethodIdentifier); } } ////// defines if funtion has distict annotation /// internal DistinctKind DistinctKind { get { return _distinctKind; } } ////// argument list /// internal ExprListArgs { get { return _args; } } /// /// optional relationship list /// internal ExprListRelationships { get { return _relationships; } } /// /// Returns true if there are associated relationship expressions /// internal bool HasRelationships { get { return null != _relationships && _relationships.Count > 0; } } // // Aggregate helpers // ////// defines an internal name to be used as aggregate function /// used by semantic conversion /// internal string InternalAggregateName { get { return _internalAggregateName; } } ////// defines if a given function is aggregate /// used by semantic conversion /// internal bool WasResolved { get { return (null != _internalAggregateName); } } internal DbExpression DummyExpression { get { return _dummyExpression; } } internal void SetAggregateInfo( string internalAggregateName, DbExpression dummyExpr ) { Debug.Assert(internalAggregateName != null); Debug.Assert(dummyExpr != null); _internalAggregateName = internalAggregateName; _dummyExpression = dummyExpr; } internal void ResetDummyExpression() { _dummyExpression = null; } internal void ResetAggregateInfo() { _internalAggregateName = null; _dummyExpression = null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backup [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Diagnostics; ////// represents a method/function/aggregate function/type constructor expression /// internal sealed class MethodExpr : Expr { private Expr _leftExpr; private Identifier _methodIdentifier; private DistinctKind _distinctKind; private ExprList_args; private string _internalAggregateName; private DbExpression _dummyExpression = null; private ExprList _relationships; /// /// initializes method ast node /// /// /// /// /// internal MethodExpr( Expr left, Identifier methodId, DistinctKind distinctKind, ExprListargs ) { _leftExpr = left; _methodIdentifier = methodId; _distinctKind = distinctKind; _args = args; } /// /// intializes a method ast node /// /// /// /// /// /// internal MethodExpr(Expr left, Identifier methodId, DistinctKind distinctKind, ExprListargs, ExprList relationships) { _leftExpr = left; _methodIdentifier = methodId; _distinctKind = distinctKind; _args = args; _relationships = relationships; } /// /// left expression /// internal Expr LeftExpr { get { return _leftExpr; } } ////// method identifier /// internal Identifier MethodIdentifier { get { return _methodIdentifier; } } ////// method name /// internal string MethodName { get { return MethodIdentifier.Name; } } ////// returns a dotexpr with the entire prefix /// internal DotExpr MethodPrefixExpr { get { return new DotExpr(LeftExpr, MethodIdentifier); } } ////// defines if funtion has distict annotation /// internal DistinctKind DistinctKind { get { return _distinctKind; } } ////// argument list /// internal ExprListArgs { get { return _args; } } /// /// optional relationship list /// internal ExprListRelationships { get { return _relationships; } } /// /// Returns true if there are associated relationship expressions /// internal bool HasRelationships { get { return null != _relationships && _relationships.Count > 0; } } // // Aggregate helpers // ////// defines an internal name to be used as aggregate function /// used by semantic conversion /// internal string InternalAggregateName { get { return _internalAggregateName; } } ////// defines if a given function is aggregate /// used by semantic conversion /// internal bool WasResolved { get { return (null != _internalAggregateName); } } internal DbExpression DummyExpression { get { return _dummyExpression; } } internal void SetAggregateInfo( string internalAggregateName, DbExpression dummyExpr ) { Debug.Assert(internalAggregateName != null); Debug.Assert(dummyExpr != null); _internalAggregateName = internalAggregateName; _dummyExpression = dummyExpr; } internal void ResetDummyExpression() { _dummyExpression = null; } internal void ResetAggregateInfo() { _internalAggregateName = null; _dummyExpression = null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UserControl.cs
- FileUpload.cs
- BitHelper.cs
- __TransparentProxy.cs
- _TimerThread.cs
- DataSourceSelectArguments.cs
- ElementUtil.cs
- Int64AnimationBase.cs
- SerTrace.cs
- QilTargetType.cs
- compensatingcollection.cs
- XmlCharCheckingWriter.cs
- SecurityTokenResolver.cs
- TextRangeSerialization.cs
- DesignerCategoryAttribute.cs
- ProcessThread.cs
- XmlSequenceWriter.cs
- NotifyCollectionChangedEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- WhileDesigner.xaml.cs
- UIElement.cs
- StrongNameUtility.cs
- safex509handles.cs
- XmlValidatingReader.cs
- ByteAnimationBase.cs
- RangeEnumerable.cs
- ArrayWithOffset.cs
- AsyncDataRequest.cs
- Int32RectValueSerializer.cs
- BulletChrome.cs
- PrintDialog.cs
- MouseGesture.cs
- CommandBinding.cs
- CompiledAction.cs
- ColorPalette.cs
- CodeTypeMemberCollection.cs
- StoreContentChangedEventArgs.cs
- FilterInvalidBodyAccessException.cs
- DataServiceContext.cs
- RotateTransform.cs
- FileUtil.cs
- StaticTextPointer.cs
- DataGridViewLinkColumn.cs
- DataPagerFieldCollection.cs
- EntityDesignerUtils.cs
- Effect.cs
- StrongNameIdentityPermission.cs
- HttpStreamFormatter.cs
- HotSpot.cs
- OpenTypeCommon.cs
- FormsIdentity.cs
- DefaultPropertiesToSend.cs
- ScrollEvent.cs
- HttpPostServerProtocol.cs
- DiscoveryClientDocuments.cs
- NCryptSafeHandles.cs
- PerspectiveCamera.cs
- OutputCacheModule.cs
- BaseResourcesBuildProvider.cs
- DispatcherHooks.cs
- RegexReplacement.cs
- BitmapEffectInput.cs
- AddInContractAttribute.cs
- WhitespaceSignificantCollectionAttribute.cs
- ITreeGenerator.cs
- AttributeEmitter.cs
- SByteConverter.cs
- CheckPair.cs
- DataBoundControlAdapter.cs
- PropagatorResult.cs
- HtmlDocument.cs
- _StreamFramer.cs
- EnumMemberAttribute.cs
- ParentControlDesigner.cs
- _SslState.cs
- ApplicationSettingsBase.cs
- HttpFileCollectionBase.cs
- ListViewGroup.cs
- FixedSOMSemanticBox.cs
- SettingsProperty.cs
- RandomNumberGenerator.cs
- TypeBuilder.cs
- TraceSwitch.cs
- SymbolType.cs
- InvalidateEvent.cs
- ButtonBase.cs
- CategoryGridEntry.cs
- DeclarativeConditionsCollection.cs
- TreeViewImageKeyConverter.cs
- OutputScopeManager.cs
- SmtpMail.cs
- FileReservationCollection.cs
- SqlMultiplexer.cs
- BitmapEffectGroup.cs
- BCLDebug.cs
- DataDocumentXPathNavigator.cs
- HtmlToClrEventProxy.cs
- validationstate.cs
- VarRefManager.cs
- DataSetViewSchema.cs