Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / TakeQueryOptionExpression.cs / 2 / 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
- SqlUtils.cs
- FixedSOMLineRanges.cs
- ActivityCodeGenerator.cs
- DataGridViewComboBoxColumn.cs
- DataPagerCommandEventArgs.cs
- DataBindingCollection.cs
- CatalogPartCollection.cs
- HierarchicalDataBoundControl.cs
- HelloOperationAsyncResult.cs
- COM2Properties.cs
- SettingsProperty.cs
- DbBuffer.cs
- DoubleCollection.cs
- ClickablePoint.cs
- GifBitmapDecoder.cs
- GraphicsContainer.cs
- CaseInsensitiveHashCodeProvider.cs
- DataMemberListEditor.cs
- SapiRecoContext.cs
- OleDbErrorCollection.cs
- DataGridAddNewRow.cs
- EpmSyndicationContentSerializer.cs
- DispatchWrapper.cs
- DSASignatureFormatter.cs
- ObfuscationAttribute.cs
- HealthMonitoringSectionHelper.cs
- DataGridViewTextBoxCell.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- RuleRefElement.cs
- DiagnosticsConfiguration.cs
- _BaseOverlappedAsyncResult.cs
- PieceDirectory.cs
- ForeignKeyFactory.cs
- ListControlConvertEventArgs.cs
- HealthMonitoringSectionHelper.cs
- ListItemParagraph.cs
- PickDesigner.xaml.cs
- ExpressionBuilder.cs
- CacheMemory.cs
- ToolboxComponentsCreatedEventArgs.cs
- ValidationHelper.cs
- InvariantComparer.cs
- StringKeyFrameCollection.cs
- SqlTransaction.cs
- BackEase.cs
- StorageBasedPackageProperties.cs
- SecureEnvironment.cs
- SpeechDetectedEventArgs.cs
- FlowDocumentPage.cs
- Int32Collection.cs
- BaseDataListActionList.cs
- CorrelationRequestContext.cs
- ObjectItemConventionAssemblyLoader.cs
- AnnotationObservableCollection.cs
- UniqueContractNameValidationBehavior.cs
- CfgSemanticTag.cs
- GridItemCollection.cs
- TokenizerHelper.cs
- SafeFindHandle.cs
- EntityChangedParams.cs
- HttpCookieCollection.cs
- LabelLiteral.cs
- ResXResourceSet.cs
- _Events.cs
- FontFamilyIdentifier.cs
- SchemaCreator.cs
- XmlAttributes.cs
- Win32.cs
- Schedule.cs
- StagingAreaInputItem.cs
- StateMachine.cs
- FrameworkContentElement.cs
- ConfigurationStrings.cs
- DictionaryBase.cs
- InfoCardServiceInstallComponent.cs
- SQLInt16.cs
- StaticResourceExtension.cs
- ListControl.cs
- PTProvider.cs
- EventLogPermissionAttribute.cs
- DiscoveryClientOutputChannel.cs
- PageBorderless.cs
- OrCondition.cs
- ValidatorCollection.cs
- SimpleMailWebEventProvider.cs
- SapiRecognizer.cs
- SerializerProvider.cs
- AlphaSortedEnumConverter.cs
- CodeEntryPointMethod.cs
- AssemblyCollection.cs
- ObjectTokenCategory.cs
- WsrmMessageInfo.cs
- QuaternionValueSerializer.cs
- DocumentViewerAutomationPeer.cs
- ProfileInfo.cs
- JsonByteArrayDataContract.cs
- XmlElementAttributes.cs
- Point.cs
- BamlCollectionHolder.cs
- ToolConsole.cs