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
- SymbolEqualComparer.cs
- VariableAction.cs
- sqlpipe.cs
- BamlLocalizabilityResolver.cs
- SemanticBasicElement.cs
- SmiGettersStream.cs
- AttachedProperty.cs
- HealthMonitoringSection.cs
- DataException.cs
- Span.cs
- SystemTcpConnection.cs
- WindowsFormsLinkLabel.cs
- MergePropertyDescriptor.cs
- BinaryFormatter.cs
- NamespaceInfo.cs
- SoapSchemaImporter.cs
- BinaryReader.cs
- DocumentXPathNavigator.cs
- AccessibleObject.cs
- ApplicationActivator.cs
- BulletChrome.cs
- DiscoveryServerProtocol.cs
- FormViewRow.cs
- NavigationHelper.cs
- GridView.cs
- SystemIPGlobalStatistics.cs
- DataGridViewCheckBoxColumn.cs
- SafeFileMappingHandle.cs
- TemplatedAdorner.cs
- RouteUrlExpressionBuilder.cs
- NotImplementedException.cs
- Win32KeyboardDevice.cs
- EnumerableRowCollection.cs
- BufferAllocator.cs
- IFlowDocumentViewer.cs
- StateManager.cs
- HWStack.cs
- ExitEventArgs.cs
- DashStyle.cs
- MD5CryptoServiceProvider.cs
- Panel.cs
- XmlNode.cs
- DesignTimeSiteMapProvider.cs
- ParagraphVisual.cs
- SafeReversePInvokeHandle.cs
- OpenTypeLayout.cs
- NumericExpr.cs
- AppDomainProtocolHandler.cs
- XamlSerializerUtil.cs
- OpCodes.cs
- ProtocolViolationException.cs
- FrameworkElementAutomationPeer.cs
- ScriptServiceAttribute.cs
- LinkDescriptor.cs
- ReadOnlyCollection.cs
- GridViewPageEventArgs.cs
- OletxEnlistment.cs
- _ConnectionGroup.cs
- RequestSecurityTokenSerializer.cs
- FontStyles.cs
- FormViewUpdateEventArgs.cs
- TableLayout.cs
- TextRangeSerialization.cs
- IntersectQueryOperator.cs
- CheckBoxField.cs
- CollectionConverter.cs
- StateMachineDesignerPaint.cs
- Cell.cs
- ContextStaticAttribute.cs
- SafeCryptoHandles.cs
- NoResizeHandleGlyph.cs
- GestureRecognizer.cs
- FillRuleValidation.cs
- TraceContextRecord.cs
- EnvironmentPermission.cs
- DefaultPropertyAttribute.cs
- SqlNodeAnnotation.cs
- DefaultShape.cs
- SigningCredentials.cs
- ChineseLunisolarCalendar.cs
- httpapplicationstate.cs
- ControlBindingsCollection.cs
- EtwProvider.cs
- XmlSchemaValidator.cs
- AutoCompleteStringCollection.cs
- DataServiceQueryProvider.cs
- PackWebRequestFactory.cs
- CodeDomSerializer.cs
- DbXmlEnabledProviderManifest.cs
- XmlSchemaAppInfo.cs
- Rotation3DAnimationBase.cs
- TypeDependencyAttribute.cs
- CalendarDateRange.cs
- ViewLoader.cs
- TypeDescriptorFilterService.cs
- ImageConverter.cs
- PerspectiveCamera.cs
- UnsignedPublishLicense.cs
- Header.cs
- CookielessData.cs