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
- CommandID.cs
- EdgeProfileValidation.cs
- GroupBoxAutomationPeer.cs
- TreeBuilderBamlTranslator.cs
- SQLSingle.cs
- WebServiceMethodData.cs
- ArgumentNullException.cs
- Rfc2898DeriveBytes.cs
- XsdDateTime.cs
- GridViewRow.cs
- SafeFileMappingHandle.cs
- InvalidDataContractException.cs
- DragSelectionMessageFilter.cs
- EntityDataSourceMemberPath.cs
- UpDownBase.cs
- ColorConverter.cs
- ActivityAction.cs
- SurrogateEncoder.cs
- ConfigurationPermission.cs
- LicenseProviderAttribute.cs
- StringValueConverter.cs
- ListControlConvertEventArgs.cs
- XamlTemplateSerializer.cs
- HandleCollector.cs
- ComponentEvent.cs
- WindowsButton.cs
- FillErrorEventArgs.cs
- RadioButton.cs
- Splitter.cs
- SvcMapFileSerializer.cs
- EdmConstants.cs
- CompilerErrorCollection.cs
- MostlySingletonList.cs
- DataPagerCommandEventArgs.cs
- CfgArc.cs
- UnsafeNativeMethods.cs
- EditorPartDesigner.cs
- XmlDataSourceDesigner.cs
- EntityCommandCompilationException.cs
- NavigatingCancelEventArgs.cs
- TextStore.cs
- BamlLocalizableResourceKey.cs
- MarginsConverter.cs
- MethodBuilderInstantiation.cs
- TreeNodeConverter.cs
- GiveFeedbackEvent.cs
- BufferedWebEventProvider.cs
- DataGridViewColumnConverter.cs
- SystemNetHelpers.cs
- DataGridColumn.cs
- QilDataSource.cs
- ToolStripPanelRenderEventArgs.cs
- ShapeTypeface.cs
- DropShadowEffect.cs
- HtmlButton.cs
- SqlInternalConnectionTds.cs
- Activator.cs
- TimersDescriptionAttribute.cs
- DataSourceViewSchemaConverter.cs
- WebHttpSecurity.cs
- InternalDispatchObject.cs
- DocumentPageTextView.cs
- InboundActivityHelper.cs
- Point3DKeyFrameCollection.cs
- ManifestResourceInfo.cs
- XmlSerializationGeneratedCode.cs
- OptimalBreakSession.cs
- WebPartConnectionsCloseVerb.cs
- RectAnimationClockResource.cs
- WrappedIUnknown.cs
- OutputCacheSection.cs
- FormDocumentDesigner.cs
- SystemException.cs
- NameValuePair.cs
- WindowsListViewSubItem.cs
- PeerNameRegistration.cs
- QilPatternFactory.cs
- TextSelectionProcessor.cs
- CodeTypeParameter.cs
- MessageQueueKey.cs
- DynamicResourceExtensionConverter.cs
- TreeIterators.cs
- XmlIlVisitor.cs
- LocationFactory.cs
- NetSectionGroup.cs
- PathFigure.cs
- EntityRecordInfo.cs
- ControlCollection.cs
- MdImport.cs
- BackgroundFormatInfo.cs
- ExpandCollapseProviderWrapper.cs
- ListItemParagraph.cs
- RsaKeyIdentifierClause.cs
- ContainsRowNumberChecker.cs
- FactoryId.cs
- AppDomainInstanceProvider.cs
- HttpException.cs
- LogLogRecordEnumerator.cs
- ListViewInsertedEventArgs.cs
- ChtmlLinkAdapter.cs