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
- ParallelEnumerable.cs
- SoapFault.cs
- RequestQueue.cs
- Compensate.cs
- Trace.cs
- ValueTypeFixupInfo.cs
- DataKey.cs
- ErrorHandlerFaultInfo.cs
- WmlValidationSummaryAdapter.cs
- VisualStyleElement.cs
- ButtonFieldBase.cs
- ProfileGroupSettingsCollection.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- EDesignUtil.cs
- PropertyTab.cs
- UnionCodeGroup.cs
- Attributes.cs
- _CommandStream.cs
- SoapMessage.cs
- odbcmetadatacolumnnames.cs
- PrimarySelectionAdorner.cs
- LayoutTableCell.cs
- CustomTypeDescriptor.cs
- EvidenceBase.cs
- OLEDB_Util.cs
- SqlCacheDependencySection.cs
- CancellationState.cs
- filewebresponse.cs
- WindowsScrollBar.cs
- ProcessModelInfo.cs
- TimeoutHelper.cs
- ExpandableObjectConverter.cs
- ReadOnlyCollectionBase.cs
- AccessViolationException.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- mediaclock.cs
- XmlBaseReader.cs
- TypeConverterHelper.cs
- OleDbCommandBuilder.cs
- BinaryVersion.cs
- SecurityTokenRequirement.cs
- DataBindingHandlerAttribute.cs
- RpcCryptoRequest.cs
- GradientBrush.cs
- FormViewPagerRow.cs
- ConvertersCollection.cs
- AspProxy.cs
- TypeUsage.cs
- EventProviderTraceListener.cs
- ComponentResourceManager.cs
- PropertyHelper.cs
- SubstitutionList.cs
- InvalidProgramException.cs
- BitmapEffectRenderDataResource.cs
- AutoGeneratedFieldProperties.cs
- RegexParser.cs
- SimpleWorkerRequest.cs
- OracleParameterCollection.cs
- EntityDataSourceSelectedEventArgs.cs
- PermissionSetEnumerator.cs
- SoapSchemaExporter.cs
- MemoryFailPoint.cs
- EntityProviderFactory.cs
- InkPresenter.cs
- DataServiceExpressionVisitor.cs
- TypeElementCollection.cs
- BufferedGraphics.cs
- IChannel.cs
- BackgroundFormatInfo.cs
- RequestResizeEvent.cs
- WindowsStatic.cs
- ElementInit.cs
- SHA512.cs
- CompositeActivityValidator.cs
- ApplyImportsAction.cs
- ByteAnimationUsingKeyFrames.cs
- ApplicationManager.cs
- SystemResourceHost.cs
- PersonalizationProviderCollection.cs
- OperationAbortedException.cs
- RoleExceptions.cs
- DurationConverter.cs
- ObjectContext.cs
- CodeGeneratorAttribute.cs
- Schema.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- Variable.cs
- EpmSyndicationContentSerializer.cs
- MappedMetaModel.cs
- LineVisual.cs
- WFItemsToSpacerVisibility.cs
- cookieexception.cs
- OptimalBreakSession.cs
- Sorting.cs
- Wow64ConfigurationLoader.cs
- XmlSecureResolver.cs
- NameValuePair.cs
- DataBoundControlAdapter.cs
- XmlSchemaCollection.cs
- recordstatefactory.cs