Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / TakeQueryOptionExpression.cs / 2 / 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
- DataPagerField.cs
- _NestedMultipleAsyncResult.cs
- InkCanvas.cs
- StorageAssociationSetMapping.cs
- BmpBitmapDecoder.cs
- BatchParser.cs
- DefaultTextStore.cs
- ConcatQueryOperator.cs
- TableDesigner.cs
- Assert.cs
- BitmapFrameDecode.cs
- DataControlPagerLinkButton.cs
- Line.cs
- Ipv6Element.cs
- QilVisitor.cs
- RtfNavigator.cs
- HtmlInputHidden.cs
- Stroke2.cs
- CompositionTarget.cs
- RenderData.cs
- Lease.cs
- TreeWalkHelper.cs
- AnimatedTypeHelpers.cs
- EngineSiteSapi.cs
- WrappedIUnknown.cs
- ElementHostPropertyMap.cs
- DataGridHyperlinkColumn.cs
- SafeBitVector32.cs
- EdmProperty.cs
- ActivityCodeDomSerializer.cs
- FieldToken.cs
- SystemWebCachingSectionGroup.cs
- UserValidatedEventArgs.cs
- UIntPtr.cs
- InputMethod.cs
- AssemblyBuilder.cs
- PngBitmapDecoder.cs
- ContractInstanceProvider.cs
- AssociationType.cs
- DataObjectFieldAttribute.cs
- LookupNode.cs
- DependencyPropertyHelper.cs
- HttpResponse.cs
- OperatingSystem.cs
- EventLogEntry.cs
- WinFormsComponentEditor.cs
- HTMLTagNameToTypeMapper.cs
- XamlSerializerUtil.cs
- TreeView.cs
- SecurityPolicySection.cs
- SessionParameter.cs
- isolationinterop.cs
- ResolveMatchesApril2005.cs
- Int64Converter.cs
- HtmlInputControl.cs
- HttpResponse.cs
- MarkupExtensionParser.cs
- IPAddress.cs
- RequiredAttributeAttribute.cs
- UpdateRecord.cs
- RegisteredHiddenField.cs
- RepeatInfo.cs
- Expr.cs
- XmlAttributeCache.cs
- XmlSchemaNotation.cs
- LoadRetryConstantStrategy.cs
- TypeValidationEventArgs.cs
- SqlCachedBuffer.cs
- XmlCountingReader.cs
- SystemResourceKey.cs
- JavaScriptSerializer.cs
- ScriptingScriptResourceHandlerSection.cs
- RtfToXamlReader.cs
- ClientScriptManager.cs
- DomainConstraint.cs
- NativeObjectSecurity.cs
- PointLightBase.cs
- ProcessThreadCollection.cs
- HttpApplicationFactory.cs
- _NestedMultipleAsyncResult.cs
- RSACryptoServiceProvider.cs
- ColorTransformHelper.cs
- Wow64ConfigurationLoader.cs
- LicFileLicenseProvider.cs
- DataGridViewRowPrePaintEventArgs.cs
- DocobjHost.cs
- EmptyReadOnlyDictionaryInternal.cs
- WindowCollection.cs
- FontStretches.cs
- WindowsContainer.cs
- SiteOfOriginContainer.cs
- QueryOperationResponseOfT.cs
- VirtualPathProvider.cs
- RtfToXamlLexer.cs
- HandleCollector.cs
- SelectManyQueryOperator.cs
- QfeChecker.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- RefType.cs
- SimpleType.cs