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
- PermissionListSet.cs
- PackageRelationship.cs
- AsyncOperation.cs
- XmlSchemaIdentityConstraint.cs
- DynamicMetaObjectBinder.cs
- EntityReference.cs
- OracleConnectionFactory.cs
- DesignConnectionCollection.cs
- ManifestResourceInfo.cs
- FtpWebRequest.cs
- MemberExpression.cs
- PageCatalogPart.cs
- XmlSerializerFactory.cs
- BaseValidator.cs
- CheckPair.cs
- RequestCacheValidator.cs
- LogSwitch.cs
- ChangeDirector.cs
- D3DImage.cs
- MouseButtonEventArgs.cs
- HideDisabledControlAdapter.cs
- FontDriver.cs
- SafePEFileHandle.cs
- TextStore.cs
- Authorization.cs
- IUnknownConstantAttribute.cs
- DefaultProxySection.cs
- CookieHandler.cs
- ServiceModelDictionary.cs
- XPathNodePointer.cs
- FixedSOMPageElement.cs
- WmlPanelAdapter.cs
- FileDialog_Vista_Interop.cs
- BeginEvent.cs
- XmlSequenceWriter.cs
- HttpAsyncResult.cs
- PagesChangedEventArgs.cs
- VirtualPathUtility.cs
- ParseNumbers.cs
- ServiceNameElement.cs
- Int64Storage.cs
- RangeValidator.cs
- ValidationEventArgs.cs
- UriTemplateTrieNode.cs
- VisualStyleRenderer.cs
- SimpleType.cs
- DynamicScriptObject.cs
- ToolboxItemAttribute.cs
- FlowLayoutSettings.cs
- TextRunCacheImp.cs
- ConstantSlot.cs
- DocumentPageTextView.cs
- Guid.cs
- CfgArc.cs
- RequestQueue.cs
- ToolboxService.cs
- ButtonBaseAdapter.cs
- PrincipalPermission.cs
- CompositeControl.cs
- XomlCompilerError.cs
- ToolBar.cs
- Pkcs7Recipient.cs
- WindowsScrollBarBits.cs
- AddInControllerImpl.cs
- MdiWindowListStrip.cs
- TemplateInstanceAttribute.cs
- EncryptedType.cs
- ControlAdapter.cs
- XmlSequenceWriter.cs
- HttpWrapper.cs
- EndOfStreamException.cs
- DynamicEndpoint.cs
- StateFinalizationDesigner.cs
- IndexingContentUnit.cs
- VoiceInfo.cs
- Repeater.cs
- FormatException.cs
- DictionaryMarkupSerializer.cs
- X509Certificate2.cs
- DataBindingCollection.cs
- HwndAppCommandInputProvider.cs
- SqlNodeTypeOperators.cs
- Completion.cs
- ReaderContextStackData.cs
- KeyBinding.cs
- TableRow.cs
- LongCountAggregationOperator.cs
- XmlLanguageConverter.cs
- TextPenaltyModule.cs
- NumericUpDownAcceleration.cs
- TimeSpanOrInfiniteConverter.cs
- WorkflowValidationFailedException.cs
- ObjectItemLoadingSessionData.cs
- WSIdentityFaultException.cs
- ComboBox.cs
- OpenTypeCommon.cs
- contentDescriptor.cs
- RuleInfoComparer.cs
- AutomationElement.cs
- WebConvert.cs