Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SettingsSavedEventArgs.cs
- AxisAngleRotation3D.cs
- XmlMtomReader.cs
- CardSpaceException.cs
- DynamicDocumentPaginator.cs
- GridViewRowEventArgs.cs
- BaseTemplateBuildProvider.cs
- ViewManager.cs
- GACIdentityPermission.cs
- Figure.cs
- XmlAtomicValue.cs
- WinInetCache.cs
- Timer.cs
- DurableServiceAttribute.cs
- CodeMemberMethod.cs
- AVElementHelper.cs
- RsaKeyGen.cs
- SymmetricAlgorithm.cs
- PropertyTabChangedEvent.cs
- DBSchemaRow.cs
- X509Certificate2Collection.cs
- Accessible.cs
- AssertHelper.cs
- ParallelActivityDesigner.cs
- LogRestartAreaEnumerator.cs
- ReadOnlyDictionary.cs
- SystemDiagnosticsSection.cs
- ListBindableAttribute.cs
- DelayedRegex.cs
- LineBreak.cs
- StructuredTypeEmitter.cs
- GridViewRow.cs
- WindowsListViewSubItem.cs
- Rfc2898DeriveBytes.cs
- SystemWebSectionGroup.cs
- BitmapMetadataBlob.cs
- PropertyChangedEventArgs.cs
- PermissionListSet.cs
- MetadataCacheItem.cs
- DataGridViewColumnEventArgs.cs
- HttpCacheVary.cs
- OpacityConverter.cs
- ObjRef.cs
- ClipboardData.cs
- Comparer.cs
- TableHeaderCell.cs
- ValidationContext.cs
- Vector3dCollection.cs
- EntityDataSource.cs
- TextEndOfParagraph.cs
- FileUpload.cs
- SuspendDesigner.cs
- SAPICategories.cs
- ContentElement.cs
- InstanceDescriptor.cs
- WorkItem.cs
- ChannelSinkStacks.cs
- DataGridSortCommandEventArgs.cs
- Model3DGroup.cs
- SessionEndedEventArgs.cs
- HealthMonitoringSectionHelper.cs
- RealizationContext.cs
- FieldNameLookup.cs
- OutputCacheProviderCollection.cs
- DynamicPropertyHolder.cs
- UITypeEditor.cs
- ContentPathSegment.cs
- HitTestDrawingContextWalker.cs
- Object.cs
- _ConnectOverlappedAsyncResult.cs
- _ConnectStream.cs
- XmlSchemaFacet.cs
- DataGridViewRowPostPaintEventArgs.cs
- SamlConstants.cs
- WebPartMinimizeVerb.cs
- MarkupExtensionParser.cs
- TypeElementCollection.cs
- AttachedPropertiesService.cs
- TaiwanLunisolarCalendar.cs
- UInt32Converter.cs
- Link.cs
- _ConnectOverlappedAsyncResult.cs
- ToolStripItemGlyph.cs
- SemaphoreFullException.cs
- XmlDocumentType.cs
- ConnectorSelectionGlyph.cs
- LoginUtil.cs
- SchemaNames.cs
- StreamWriter.cs
- UrlMappingCollection.cs
- JapaneseLunisolarCalendar.cs
- PipeSecurity.cs
- DateTime.cs
- ModuleBuilder.cs
- RedirectionProxy.cs
- ChannelTokenTypeConverter.cs
- UpdatePanelTriggerCollection.cs
- InvariantComparer.cs
- DnsPermission.cs
- DetailsViewCommandEventArgs.cs