Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / TakeQueryOptionExpression.cs / 1 / 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
- BitmapFrameEncode.cs
- VariantWrapper.cs
- AliasGenerator.cs
- SqlUdtInfo.cs
- BinaryConverter.cs
- MenuEventArgs.cs
- StorageFunctionMapping.cs
- HierarchicalDataTemplate.cs
- BypassElement.cs
- RegexFCD.cs
- CalendarTable.cs
- LabelExpression.cs
- DesignerDataTable.cs
- XmlAnyAttributeAttribute.cs
- TreeWalkHelper.cs
- X509Certificate.cs
- FreeFormDragDropManager.cs
- EnumUnknown.cs
- WinEventQueueItem.cs
- EventLogStatus.cs
- MergePropertyDescriptor.cs
- DictionaryContent.cs
- DurableInstanceProvider.cs
- DefaultIfEmptyQueryOperator.cs
- ScopelessEnumAttribute.cs
- SecondaryIndexDefinition.cs
- ObjectStateFormatter.cs
- TextElementEditingBehaviorAttribute.cs
- XmlCustomFormatter.cs
- CodeBlockBuilder.cs
- Int16Converter.cs
- Compilation.cs
- ConfigXmlText.cs
- PackWebRequestFactory.cs
- SimpleRecyclingCache.cs
- GroupBox.cs
- Overlapped.cs
- KoreanCalendar.cs
- IntranetCredentialPolicy.cs
- typedescriptorpermission.cs
- GridViewColumnHeaderAutomationPeer.cs
- SqlConnectionManager.cs
- TrustLevelCollection.cs
- InvalidCastException.cs
- HtmlEncodedRawTextWriter.cs
- OverlappedAsyncResult.cs
- RichTextBoxConstants.cs
- DataService.cs
- TypeGeneratedEventArgs.cs
- ProcessModule.cs
- GradientBrush.cs
- InteropDesigner.xaml.cs
- CustomErrorsSectionWrapper.cs
- Configuration.cs
- DataGridViewComboBoxColumn.cs
- UserPersonalizationStateInfo.cs
- AsyncPostBackTrigger.cs
- ClientTargetSection.cs
- SecUtil.cs
- WindowsScrollBarBits.cs
- ExpressionsCollectionEditor.cs
- OrderPreservingPipeliningSpoolingTask.cs
- Blend.cs
- BamlLocalizationDictionary.cs
- InputScopeConverter.cs
- DeclarationUpdate.cs
- CanonicalizationDriver.cs
- OperationCanceledException.cs
- RemoteWebConfigurationHostServer.cs
- Cursor.cs
- ScaleTransform3D.cs
- Cursor.cs
- CatchBlock.cs
- XPathExpr.cs
- ObservableCollectionDefaultValueFactory.cs
- XmlSchemaSimpleContentRestriction.cs
- TableParagraph.cs
- SqlConnectionFactory.cs
- TransformConverter.cs
- PixelFormats.cs
- Configuration.cs
- CodeTypeReferenceSerializer.cs
- SystemParameters.cs
- RegistrySecurity.cs
- XmlMapping.cs
- messageonlyhwndwrapper.cs
- cookieexception.cs
- XmlAnyElementAttributes.cs
- GeneralTransform2DTo3DTo2D.cs
- WriteableBitmap.cs
- StoreAnnotationsMap.cs
- StringFreezingAttribute.cs
- LiteralText.cs
- Rotation3DKeyFrameCollection.cs
- CodeTypeReference.cs
- DetailsViewDeletedEventArgs.cs
- WaitingCursor.cs
- ThreadAbortException.cs
- Utils.cs
- ValueProviderWrapper.cs