Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / MethodExpr.cs / 1 / 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
- OperationParameterInfo.cs
- WebScriptEnablingBehavior.cs
- WebConfigurationHost.cs
- GeometryHitTestParameters.cs
- DependencyPropertyKey.cs
- WmlListAdapter.cs
- ProtocolsSection.cs
- EntityDataSourceSelectedEventArgs.cs
- TransformDescriptor.cs
- HMACMD5.cs
- SessionEndedEventArgs.cs
- SQLSingle.cs
- WeakReferenceList.cs
- FieldBuilder.cs
- SchemaElement.cs
- EmptyStringExpandableObjectConverter.cs
- HashCodeCombiner.cs
- CallId.cs
- StylusCollection.cs
- CacheHelper.cs
- DesignConnection.cs
- MimeTextImporter.cs
- BamlRecordHelper.cs
- ObjectNotFoundException.cs
- ParameterReplacerVisitor.cs
- DataTablePropertyDescriptor.cs
- InteropBitmapSource.cs
- ManagementException.cs
- ImageCodecInfo.cs
- Misc.cs
- SelectionList.cs
- KeyValueSerializer.cs
- QilInvokeLateBound.cs
- StrongName.cs
- COM2ExtendedUITypeEditor.cs
- CrossSiteScriptingValidation.cs
- TypeBrowserDialog.cs
- InvalidFilterCriteriaException.cs
- PageParserFilter.cs
- BufferedConnection.cs
- VoiceInfo.cs
- CatalogZone.cs
- SearchForVirtualItemEventArgs.cs
- DescendantOverDescendantQuery.cs
- RecommendedAsConfigurableAttribute.cs
- CodeNamespaceImport.cs
- WebCategoryAttribute.cs
- ButtonStandardAdapter.cs
- WebEvents.cs
- SamlConstants.cs
- UnknownBitmapDecoder.cs
- ToggleButton.cs
- ProcessInfo.cs
- Rotation3D.cs
- SafeThemeHandle.cs
- CombinedGeometry.cs
- CachedFontFamily.cs
- XmlILModule.cs
- _HelperAsyncResults.cs
- InlinedLocationReference.cs
- Profiler.cs
- ClientProxyGenerator.cs
- MenuItemBindingCollection.cs
- HttpListenerResponse.cs
- WindowsListViewSubItem.cs
- UnsafeNativeMethods.cs
- ImportContext.cs
- VisualBrush.cs
- Row.cs
- Pkcs7Recipient.cs
- XmlArrayItemAttributes.cs
- StylusShape.cs
- LayoutEngine.cs
- RowToParametersTransformer.cs
- PaintValueEventArgs.cs
- DbConnectionPool.cs
- PartitionResolver.cs
- PrintingPermissionAttribute.cs
- BinaryFormatterWriter.cs
- GcSettings.cs
- PerformanceCounterPermissionEntryCollection.cs
- DesignerHierarchicalDataSourceView.cs
- ScriptingWebServicesSectionGroup.cs
- Screen.cs
- QueryConverter.cs
- ReferenceEqualityComparer.cs
- DataBoundLiteralControl.cs
- HtmlDocument.cs
- MobileControlsSectionHandler.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ReachFixedDocumentSerializer.cs
- PTConverter.cs
- SplitContainer.cs
- ObjectDataSourceMethodEditor.cs
- Closure.cs
- RecordBuilder.cs
- ConfigurationPropertyAttribute.cs
- Dynamic.cs
- RuleSetDialog.Designer.cs
- LineServicesCallbacks.cs