Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / TakeQueryOptionExpression.cs / 1305376 / 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
- MetafileHeader.cs
- AsymmetricSignatureFormatter.cs
- BinaryQueryOperator.cs
- HtmlAnchor.cs
- BidOverLoads.cs
- FlowPanelDesigner.cs
- Message.cs
- SecurityUniqueId.cs
- FloaterParagraph.cs
- VirtualizingStackPanel.cs
- FileSystemInfo.cs
- SecurityElement.cs
- CookielessHelper.cs
- StylusPointCollection.cs
- ResourceBinder.cs
- SystemInfo.cs
- NamespaceList.cs
- BooleanFunctions.cs
- DbProviderServices.cs
- TraceInternal.cs
- basevalidator.cs
- VerificationException.cs
- StickyNoteContentControl.cs
- Stroke2.cs
- AuthenticateEventArgs.cs
- OdbcEnvironment.cs
- StatusBar.cs
- MappingItemCollection.cs
- WinFormsSecurity.cs
- NativeMethods.cs
- FieldMetadata.cs
- TraceContextEventArgs.cs
- SafeLibraryHandle.cs
- DefaultTypeArgumentAttribute.cs
- SupportsEventValidationAttribute.cs
- DocumentsTrace.cs
- Button.cs
- ToolboxCategory.cs
- SecureStringHasher.cs
- DefaultEventAttribute.cs
- Operand.cs
- XmlHierarchicalEnumerable.cs
- UnsafeNativeMethods.cs
- DateRangeEvent.cs
- cookiecollection.cs
- InvalidEnumArgumentException.cs
- SqlCacheDependency.cs
- Guid.cs
- DictionaryGlobals.cs
- ActivityDesignerHelper.cs
- XamlPointCollectionSerializer.cs
- SqlClientWrapperSmiStreamChars.cs
- ListViewCommandEventArgs.cs
- AnnotationComponentChooser.cs
- WindowsSpinner.cs
- ValidatorCollection.cs
- EventHandlersStore.cs
- XmlValueConverter.cs
- LinkedResourceCollection.cs
- MsmqHostedTransportConfiguration.cs
- MatrixIndependentAnimationStorage.cs
- PerformanceCounterPermissionEntry.cs
- SecurityRuntime.cs
- _NegoState.cs
- ComboBoxItem.cs
- SymLanguageType.cs
- DataControlFieldCell.cs
- FreeFormDesigner.cs
- NCryptSafeHandles.cs
- Propagator.Evaluator.cs
- ProjectionCamera.cs
- EntityObject.cs
- X509SubjectKeyIdentifierClause.cs
- EdmToObjectNamespaceMap.cs
- ViewStateChangedEventArgs.cs
- RegisteredScript.cs
- NameValueCollection.cs
- _StreamFramer.cs
- FieldToken.cs
- MonthChangedEventArgs.cs
- XmlSchemaValidationException.cs
- XamlRtfConverter.cs
- DataRelationPropertyDescriptor.cs
- ExtensibleClassFactory.cs
- EncoderParameters.cs
- ListBoxAutomationPeer.cs
- ToolboxComponentsCreatedEventArgs.cs
- Exceptions.cs
- ReliableOutputSessionChannel.cs
- EntryWrittenEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs
- SchemaNamespaceManager.cs
- DataSourceCacheDurationConverter.cs
- XmlMemberMapping.cs
- PropertyValidationContext.cs
- SystemColorTracker.cs
- SerialStream.cs
- PaperSize.cs
- StoreItemCollection.cs
- WebSysDescriptionAttribute.cs