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
- PriorityRange.cs
- OracleException.cs
- DesignerAutoFormatStyle.cs
- QueryBranchOp.cs
- SqlClientMetaDataCollectionNames.cs
- CheckedListBox.cs
- XmlTextAttribute.cs
- PrivilegeNotHeldException.cs
- Point3DIndependentAnimationStorage.cs
- SvcMapFile.cs
- XslException.cs
- xml.cs
- ColumnCollectionEditor.cs
- FixedHighlight.cs
- PageTheme.cs
- DiscoveryInnerClientManaged11.cs
- ElapsedEventArgs.cs
- ExpressionPrefixAttribute.cs
- FieldMetadata.cs
- DateTimeStorage.cs
- TagPrefixAttribute.cs
- TextEndOfLine.cs
- RectAnimationBase.cs
- CatalogZoneBase.cs
- XmlSchemaExporter.cs
- PriorityBinding.cs
- CallContext.cs
- EditableTreeList.cs
- AppSettingsReader.cs
- ServiceThrottlingBehavior.cs
- CompilerLocalReference.cs
- TemplateGroupCollection.cs
- ReferentialConstraintRoleElement.cs
- DictationGrammar.cs
- DateTimeValueSerializer.cs
- ForEachAction.cs
- AddInServer.cs
- ObjectTokenCategory.cs
- FocusChangedEventArgs.cs
- SafeCoTaskMem.cs
- SliderAutomationPeer.cs
- ImageFormat.cs
- DataServiceClientException.cs
- XPathAncestorQuery.cs
- XmlNullResolver.cs
- SendMessageContent.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- MatchSingleFxEngineOpcode.cs
- KeyToListMap.cs
- EntityContainerEmitter.cs
- DataGridViewDesigner.cs
- HostProtectionPermission.cs
- SystemDiagnosticsSection.cs
- _SecureChannel.cs
- __ConsoleStream.cs
- InstanceDescriptor.cs
- BigInt.cs
- SqlStream.cs
- IriParsingElement.cs
- Inflater.cs
- SiteMapSection.cs
- ValidatorCompatibilityHelper.cs
- HttpProfileBase.cs
- SQLRoleProvider.cs
- PermissionSetTriple.cs
- DataGridViewRowConverter.cs
- FormatConvertedBitmap.cs
- TimeSpanHelper.cs
- InvalidPrinterException.cs
- diagnosticsswitches.cs
- RegexCode.cs
- DataGrid.cs
- SoapElementAttribute.cs
- CanonicalXml.cs
- ReferenceService.cs
- WebResourceUtil.cs
- Group.cs
- HyperLinkColumn.cs
- InputLanguageCollection.cs
- PartBasedPackageProperties.cs
- X500Name.cs
- CustomDictionarySources.cs
- XmlSchemaAny.cs
- EventLogRecord.cs
- XmlTextReader.cs
- WebContentFormatHelper.cs
- XmlDictionaryWriter.cs
- GcHandle.cs
- SqlIdentifier.cs
- SqlBulkCopy.cs
- MessageOperationFormatter.cs
- HeaderPanel.cs
- Assign.cs
- TreeNodeCollection.cs
- XmlAttribute.cs
- DragEvent.cs
- DbMetaDataFactory.cs
- EnumConverter.cs
- DecimalConverter.cs
- Axis.cs