Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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,
ExprList args )
{
_leftExpr = left;
_methodIdentifier = methodId;
_distinctKind = distinctKind;
_args = args;
}
///
/// intializes a method ast node
///
///
///
///
///
///
internal MethodExpr(Expr left,
Identifier methodId,
DistinctKind distinctKind,
ExprList args,
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 ExprList Args
{
get { return _args; }
}
///
/// optional relationship list
///
internal ExprList Relationships
{
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,
ExprList args )
{
_leftExpr = left;
_methodIdentifier = methodId;
_distinctKind = distinctKind;
_args = args;
}
///
/// intializes a method ast node
///
///
///
///
///
///
internal MethodExpr(Expr left,
Identifier methodId,
DistinctKind distinctKind,
ExprList args,
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 ExprList Args
{
get { return _args; }
}
///
/// optional relationship list
///
internal ExprList Relationships
{
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
- WebBaseEventKeyComparer.cs
- SiteMapHierarchicalDataSourceView.cs
- AddingNewEventArgs.cs
- Preprocessor.cs
- ButtonColumn.cs
- DbQueryCommandTree.cs
- _ScatterGatherBuffers.cs
- BitmapEffectInput.cs
- Slider.cs
- SessionStateModule.cs
- SmiRecordBuffer.cs
- DbConnectionPoolCounters.cs
- QueryRewriter.cs
- AnonymousIdentificationSection.cs
- Menu.cs
- TemplatePagerField.cs
- BamlRecordHelper.cs
- CodeTypeOfExpression.cs
- VisualStyleInformation.cs
- Permission.cs
- TextTabProperties.cs
- DataSet.cs
- ControlParameter.cs
- Ref.cs
- Facet.cs
- EntityDataSourceState.cs
- lengthconverter.cs
- XmlHierarchicalEnumerable.cs
- RelationshipSet.cs
- HMACSHA256.cs
- EntityDataSourceChangedEventArgs.cs
- TransformedBitmap.cs
- Point4DConverter.cs
- SimpleWebHandlerParser.cs
- DependencyPropertyConverter.cs
- EffectiveValueEntry.cs
- ExceptionNotification.cs
- Library.cs
- MemberAccessException.cs
- DataBinding.cs
- CodeAttachEventStatement.cs
- WebPartExportVerb.cs
- TextPointer.cs
- TreeNodeStyle.cs
- VisualStateManager.cs
- AsymmetricKeyExchangeFormatter.cs
- MatrixStack.cs
- WebPartCatalogCloseVerb.cs
- PenThread.cs
- SizeChangedEventArgs.cs
- GeneralTransform3D.cs
- XsdBuilder.cs
- AxParameterData.cs
- FormatException.cs
- InvalidContentTypeException.cs
- TimeSpanOrInfiniteConverter.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- WmfPlaceableFileHeader.cs
- CodeNamespace.cs
- SqlCrossApplyToCrossJoin.cs
- NestedContainer.cs
- Odbc32.cs
- ModuleBuilder.cs
- ToolStripItemImageRenderEventArgs.cs
- RuleSetDialog.Designer.cs
- DefinitionBase.cs
- IPAddressCollection.cs
- ProfileGroupSettingsCollection.cs
- StylusPointPropertyId.cs
- TypedRowGenerator.cs
- SQLByteStorage.cs
- SplashScreenNativeMethods.cs
- LocalizedNameDescriptionPair.cs
- ObjectManager.cs
- RoutedPropertyChangedEventArgs.cs
- PostBackTrigger.cs
- TraceUtility.cs
- webeventbuffer.cs
- Int32AnimationUsingKeyFrames.cs
- DSACryptoServiceProvider.cs
- FrameworkElement.cs
- SystemKeyConverter.cs
- HijriCalendar.cs
- ExtendedProperty.cs
- Encoder.cs
- CssStyleCollection.cs
- Utils.cs
- Stylesheet.cs
- ListViewTableCell.cs
- EntityDataSourceContextDisposingEventArgs.cs
- BaseHashHelper.cs
- SolidColorBrush.cs
- DesignDataSource.cs
- BindingCollection.cs
- FrameworkObject.cs
- StaticFileHandler.cs
- OLEDB_Util.cs
- CrossAppDomainChannel.cs
- GenericUriParser.cs
- JoinElimination.cs