Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / TakeQueryOptionExpression.cs / 1305376 / TakeQueryOptionExpression.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Respresents a take query option in resource bound expression tree. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Diagnostics; using System.Linq.Expressions; ////// An resource specific expression representing a take query option. /// [DebuggerDisplay("TakeQueryOptionExpression {TakeAmount}")] internal class TakeQueryOptionExpression : QueryOptionExpression { ///amount to skip private ConstantExpression takeAmount; ////// Creates a TakeQueryOption expression /// /// the return type of the expression /// the query option value internal TakeQueryOptionExpression(Type type, ConstantExpression takeAmount) : base((ExpressionType)ResourceExpressionType.TakeQueryOption, type) { this.takeAmount = takeAmount; } ////// query option value /// internal ConstantExpression TakeAmount { get { return this.takeAmount; } } ////// Composes the ///expression with this one when it's specified multiple times. /// to compose. /// /// The expression that results from composing the internal override QueryOptionExpression ComposeMultipleSpecification(QueryOptionExpression previous) { Debug.Assert(previous != null, "other != null"); Debug.Assert(previous.GetType() == this.GetType(), "other.GetType == this.GetType() -- otherwise it's not the same specification"); Debug.Assert(this.takeAmount != null, "this.takeAmount != null"); Debug.Assert( this.takeAmount.Type == typeof(int), "this.takeAmount.Type == typeof(int) -- otherwise it wouldn't have matched the Enumerable.Take(source, int count) signature"); int thisValue = (int)this.takeAmount.Value; int previousValue = (int)((TakeQueryOptionExpression)previous).takeAmount.Value; return (thisValue < previousValue) ? this : previous; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //expression with this one. /// // Copyright (c) Microsoft Corporation. All rights reserved. // //// Respresents a take query option in resource bound expression tree. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Diagnostics; using System.Linq.Expressions; ////// An resource specific expression representing a take query option. /// [DebuggerDisplay("TakeQueryOptionExpression {TakeAmount}")] internal class TakeQueryOptionExpression : QueryOptionExpression { ///amount to skip private ConstantExpression takeAmount; ////// Creates a TakeQueryOption expression /// /// the return type of the expression /// the query option value internal TakeQueryOptionExpression(Type type, ConstantExpression takeAmount) : base((ExpressionType)ResourceExpressionType.TakeQueryOption, type) { this.takeAmount = takeAmount; } ////// query option value /// internal ConstantExpression TakeAmount { get { return this.takeAmount; } } ////// Composes the ///expression with this one when it's specified multiple times. /// to compose. /// /// The expression that results from composing the internal override QueryOptionExpression ComposeMultipleSpecification(QueryOptionExpression previous) { Debug.Assert(previous != null, "other != null"); Debug.Assert(previous.GetType() == this.GetType(), "other.GetType == this.GetType() -- otherwise it's not the same specification"); Debug.Assert(this.takeAmount != null, "this.takeAmount != null"); Debug.Assert( this.takeAmount.Type == typeof(int), "this.takeAmount.Type == typeof(int) -- otherwise it wouldn't have matched the Enumerable.Take(source, int count) signature"); int thisValue = (int)this.takeAmount.Value; int previousValue = (int)((TakeQueryOptionExpression)previous).takeAmount.Value; return (thisValue < previousValue) ? this : previous; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.expression with this one. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TileModeValidation.cs
- ManipulationCompletedEventArgs.cs
- DiagnosticTrace.cs
- RecognitionResult.cs
- RequestCache.cs
- _CookieModule.cs
- GotoExpression.cs
- SiteIdentityPermission.cs
- BamlRecordHelper.cs
- Int32Collection.cs
- SecurityAlgorithmSuite.cs
- SystemBrushes.cs
- SplayTreeNode.cs
- UpdatePanelTriggerCollection.cs
- TreeNodeCollection.cs
- ConnectionsZoneAutoFormat.cs
- NodeFunctions.cs
- Misc.cs
- BackStopAuthenticationModule.cs
- ResourceManager.cs
- AddToCollection.cs
- MultiBinding.cs
- RtfToXamlReader.cs
- ControlBuilderAttribute.cs
- SqlDeflator.cs
- WebBrowserNavigatingEventHandler.cs
- RewritingSimplifier.cs
- XmlSchemaException.cs
- HeaderedContentControl.cs
- Transform3DGroup.cs
- FontStretch.cs
- ClaimTypeElement.cs
- HtmlInputHidden.cs
- CounterSampleCalculator.cs
- QueryUtil.cs
- ReversePositionQuery.cs
- mda.cs
- SHA384Managed.cs
- DateTimeFormat.cs
- StringValueSerializer.cs
- TTSEngineTypes.cs
- PropertyDescriptorGridEntry.cs
- XmlWrappingWriter.cs
- EditCommandColumn.cs
- ImageField.cs
- Int64.cs
- OLEDB_Util.cs
- _FtpControlStream.cs
- COAUTHIDENTITY.cs
- InstanceLockLostException.cs
- CustomError.cs
- TabletCollection.cs
- PanelDesigner.cs
- DocumentsTrace.cs
- SBCSCodePageEncoding.cs
- HttpClientChannel.cs
- FormClosingEvent.cs
- DataStreams.cs
- FontWeights.cs
- IIS7WorkerRequest.cs
- FilterException.cs
- NotifyIcon.cs
- RelationshipEnd.cs
- IOThreadTimer.cs
- QueryStoreStatusRequest.cs
- XmlBaseReader.cs
- HtmlEmptyTagControlBuilder.cs
- ServiceOperationDetailViewControl.cs
- ResourceDictionary.cs
- pingexception.cs
- ObjectViewListener.cs
- SendMailErrorEventArgs.cs
- AbstractSvcMapFileLoader.cs
- Vector3DIndependentAnimationStorage.cs
- JoinSymbol.cs
- ViewManager.cs
- QueryOperationResponseOfT.cs
- AutomationElementCollection.cs
- WebResourceAttribute.cs
- CompensatableTransactionScopeActivityDesigner.cs
- DataSvcMapFile.cs
- DocumentGridContextMenu.cs
- XmlCDATASection.cs
- StateWorkerRequest.cs
- ListViewUpdatedEventArgs.cs
- SerTrace.cs
- SR.cs
- MailSettingsSection.cs
- OdbcDataAdapter.cs
- DbParameterCollectionHelper.cs
- AttributeUsageAttribute.cs
- XamlWrapperReaders.cs
- PropertyGeneratedEventArgs.cs
- ConnectionManagementSection.cs
- WpfSharedBamlSchemaContext.cs
- PromptStyle.cs
- CryptoApi.cs
- LingerOption.cs
- UrlAuthFailedErrorFormatter.cs
- UserControlBuildProvider.cs