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
- Codec.cs
- GcSettings.cs
- StringResourceManager.cs
- wgx_sdk_version.cs
- GPRECTF.cs
- StrongTypingException.cs
- BindingListCollectionView.cs
- SizeValueSerializer.cs
- DescriptionAttribute.cs
- NavigationHelper.cs
- FileNotFoundException.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- FlowLayout.cs
- XPathDocumentNavigator.cs
- RightsManagementEncryptedStream.cs
- OrderToken.cs
- SerializerWriterEventHandlers.cs
- PageMediaType.cs
- SafeCancelMibChangeNotify.cs
- TriggerCollection.cs
- DataControlFieldCollection.cs
- Select.cs
- IpcServerChannel.cs
- TargetInvocationException.cs
- HttpListenerRequest.cs
- CharacterBuffer.cs
- MemoryFailPoint.cs
- BitmapMetadata.cs
- XhtmlTextWriter.cs
- XNameConverter.cs
- SafeNativeMemoryHandle.cs
- EnumUnknown.cs
- ISAPIWorkerRequest.cs
- ControlCachePolicy.cs
- HttpCookie.cs
- Compiler.cs
- ClientRuntime.cs
- ObjectStateFormatter.cs
- PropertyNames.cs
- WebPartConnectionsCancelVerb.cs
- TemplatedMailWebEventProvider.cs
- ParseNumbers.cs
- TiffBitmapDecoder.cs
- OleDbWrapper.cs
- SystemTcpConnection.cs
- PageAdapter.cs
- XmlBinaryReaderSession.cs
- CapabilitiesSection.cs
- JsonReader.cs
- OracleCommand.cs
- TdsValueSetter.cs
- HttpListenerPrefixCollection.cs
- ThreadExceptionEvent.cs
- XmlDocumentType.cs
- HtmlValidatorAdapter.cs
- RelationshipFixer.cs
- TraceContext.cs
- XamlTreeBuilder.cs
- DocumentOrderComparer.cs
- UnsafeNativeMethodsCLR.cs
- TemplateXamlTreeBuilder.cs
- XmlDeclaration.cs
- ListBindingConverter.cs
- Matrix3DStack.cs
- BitmapEffectDrawingContextWalker.cs
- RotateTransform.cs
- TransformedBitmap.cs
- RegistrationServices.cs
- SizeValueSerializer.cs
- FileAuthorizationModule.cs
- TextEditorContextMenu.cs
- precedingquery.cs
- BatchStream.cs
- KeyToListMap.cs
- ExpressionNode.cs
- ExpandCollapsePatternIdentifiers.cs
- OdbcErrorCollection.cs
- BindingExpressionUncommonField.cs
- WebPartConnectionsDisconnectVerb.cs
- EventSinkActivity.cs
- RequiredFieldValidator.cs
- CmsInterop.cs
- CompoundFileStorageReference.cs
- handlecollector.cs
- VoiceSynthesis.cs
- AssemblyFilter.cs
- _Win32.cs
- CheckableControlBaseAdapter.cs
- HostedTcpTransportManager.cs
- oledbmetadatacollectionnames.cs
- VSWCFServiceContractGenerator.cs
- Errors.cs
- NameTable.cs
- TransportBindingElement.cs
- XmlNodeChangedEventManager.cs
- TransactionState.cs
- WinEventWrap.cs
- SafeNativeMethods.cs
- ParserHooks.cs
- DaylightTime.cs