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
- PointIndependentAnimationStorage.cs
- TreeChangeInfo.cs
- UIntPtr.cs
- RegistrySecurity.cs
- AuthenticationConfig.cs
- Debug.cs
- TextWriterEngine.cs
- Quad.cs
- FormsAuthenticationConfiguration.cs
- RayHitTestParameters.cs
- ToolStripItemImageRenderEventArgs.cs
- GradientStop.cs
- CancelEventArgs.cs
- ProcessThreadCollection.cs
- OdbcPermission.cs
- MediaElementAutomationPeer.cs
- SpotLight.cs
- ToolBarButton.cs
- CodeIdentifier.cs
- DataListItemCollection.cs
- MultiSelectRootGridEntry.cs
- TextCompositionEventArgs.cs
- ImageDrawing.cs
- DEREncoding.cs
- ObjectView.cs
- RegexWriter.cs
- PublishLicense.cs
- SqlInternalConnectionSmi.cs
- SecurityCriticalDataForSet.cs
- SqlDataSourceQuery.cs
- ValueConversionAttribute.cs
- StrongNameKeyPair.cs
- DbMetaDataColumnNames.cs
- SchemaImporterExtensionElementCollection.cs
- ResourceContainer.cs
- FacetValueContainer.cs
- EnterpriseServicesHelper.cs
- CalculatedColumn.cs
- Button.cs
- Sql8ConformanceChecker.cs
- ThreadAbortException.cs
- InertiaExpansionBehavior.cs
- _SingleItemRequestCache.cs
- DrawItemEvent.cs
- PagerSettings.cs
- DatePickerAutomationPeer.cs
- UserMapPath.cs
- IOThreadScheduler.cs
- FormatterConverter.cs
- FormsAuthenticationCredentials.cs
- InvalidPropValue.cs
- DomNameTable.cs
- ConfigXmlElement.cs
- LinearGradientBrush.cs
- HttpCapabilitiesBase.cs
- ISO2022Encoding.cs
- DependencyPropertyChangedEventArgs.cs
- FontWeight.cs
- QueuePathDialog.cs
- StringDictionaryEditor.cs
- LingerOption.cs
- ReservationNotFoundException.cs
- SettingsContext.cs
- dataSvcMapFileLoader.cs
- TextServicesCompartmentEventSink.cs
- ButtonBaseAdapter.cs
- SafeEventHandle.cs
- BufferedReadStream.cs
- XsdCachingReader.cs
- DbProviderConfigurationHandler.cs
- XmlResolver.cs
- CDSCollectionETWBCLProvider.cs
- XPathAncestorQuery.cs
- SplitterEvent.cs
- TaiwanCalendar.cs
- DetailsViewRowCollection.cs
- NetworkInformationPermission.cs
- Pen.cs
- XmlSigningNodeWriter.cs
- MaterialCollection.cs
- FileLoadException.cs
- CookieProtection.cs
- UInt64Converter.cs
- AvTraceDetails.cs
- SqlConnectionPoolProviderInfo.cs
- LeaseManager.cs
- AutomationEvent.cs
- DataPagerFieldCommandEventArgs.cs
- pingexception.cs
- PkcsUtils.cs
- BuildProvider.cs
- MailMessage.cs
- DataGridLengthConverter.cs
- XPathMessageFilter.cs
- IgnoreFlushAndCloseStream.cs
- FeatureSupport.cs
- WindowsTitleBar.cs
- ListViewDesigner.cs
- UnescapedXmlDiagnosticData.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs