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
- PageAsyncTaskManager.cs
- Stylesheet.cs
- MsmqInputChannelListenerBase.cs
- TableStyle.cs
- ScriptingRoleServiceSection.cs
- DataChangedEventManager.cs
- FileClassifier.cs
- CollectionViewGroupInternal.cs
- FileUtil.cs
- SqlProfileProvider.cs
- AlternateViewCollection.cs
- PictureBox.cs
- XmlCustomFormatter.cs
- Opcode.cs
- Transform.cs
- LogEntry.cs
- ButtonFlatAdapter.cs
- StackOverflowException.cs
- WmlCalendarAdapter.cs
- Setter.cs
- LoginName.cs
- EncoderNLS.cs
- GridItemProviderWrapper.cs
- FixedSOMTextRun.cs
- HwndSourceParameters.cs
- CustomWebEventKey.cs
- PointCollectionConverter.cs
- PlainXmlSerializer.cs
- AtomMaterializer.cs
- IisHelper.cs
- QueryActivatableWorkflowsCommand.cs
- EventWaitHandleSecurity.cs
- StyleSelector.cs
- ClientTargetSection.cs
- GenerateScriptTypeAttribute.cs
- InputBuffer.cs
- UxThemeWrapper.cs
- CompilerCollection.cs
- PatternMatcher.cs
- QueryResponse.cs
- InputBindingCollection.cs
- ClrProviderManifest.cs
- MouseCaptureWithinProperty.cs
- GroupBox.cs
- ConfigXmlCDataSection.cs
- TypeConverter.cs
- CmsInterop.cs
- Int32Rect.cs
- CompilerGlobalScopeAttribute.cs
- TextChangedEventArgs.cs
- MediaSystem.cs
- WebSysDisplayNameAttribute.cs
- AsyncOperation.cs
- HandlerFactoryWrapper.cs
- MaterialGroup.cs
- BaseAsyncResult.cs
- SafeNativeMethods.cs
- SyndicationSerializer.cs
- WindowInteropHelper.cs
- TypeExtensionConverter.cs
- Int32KeyFrameCollection.cs
- DeriveBytes.cs
- ManifestSignatureInformation.cs
- ReadWriteObjectLock.cs
- SqlBulkCopyColumnMapping.cs
- WebExceptionStatus.cs
- ExternalException.cs
- _ContextAwareResult.cs
- GeneralTransform3DTo2D.cs
- ColorContext.cs
- PropertyGroupDescription.cs
- BuildProvidersCompiler.cs
- DataGridViewComboBoxColumn.cs
- ResolveNameEventArgs.cs
- SafeHandles.cs
- SettingsContext.cs
- WrappedDispatcherException.cs
- BinHexEncoder.cs
- Timer.cs
- TypeConverterValueSerializer.cs
- FixedStringLookup.cs
- PageCopyCount.cs
- VirtualPathProvider.cs
- WebBrowserSiteBase.cs
- XmlSchemaInferenceException.cs
- ExclusiveHandle.cs
- Propagator.cs
- ListDictionary.cs
- mediaeventshelper.cs
- DataList.cs
- DetailsViewPagerRow.cs
- OperationCanceledException.cs
- ListViewDataItem.cs
- Int64KeyFrameCollection.cs
- SizeAnimationUsingKeyFrames.cs
- Odbc32.cs
- TextElementEditingBehaviorAttribute.cs
- PersonalizationStateInfo.cs
- MultilineStringEditor.cs
- MemoryResponseElement.cs