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
- FolderNameEditor.cs
- ComponentSerializationService.cs
- DurableInstancingOptions.cs
- Size.cs
- CrossAppDomainChannel.cs
- ImageAutomationPeer.cs
- HandlerBase.cs
- ViewSimplifier.cs
- CultureTable.cs
- DSASignatureDeformatter.cs
- Msec.cs
- _FtpDataStream.cs
- GrammarBuilderBase.cs
- CurrentChangingEventManager.cs
- CodeIdentifiers.cs
- CustomAttribute.cs
- CodeCatchClauseCollection.cs
- GeometryCombineModeValidation.cs
- HttpListenerPrefixCollection.cs
- TextLineResult.cs
- TypeConverterHelper.cs
- FunctionMappingTranslator.cs
- DataSourceCache.cs
- LinqDataSourceDeleteEventArgs.cs
- RefExpr.cs
- StickyNoteContentControl.cs
- DataGridTextBox.cs
- WebPartVerb.cs
- XmlExpressionDumper.cs
- TimeoutValidationAttribute.cs
- NativeMethods.cs
- Block.cs
- ContextItem.cs
- ToolStripPanelDesigner.cs
- HttpContextServiceHost.cs
- HashAlgorithm.cs
- MimeFormImporter.cs
- SelectionHighlightInfo.cs
- BinaryObjectInfo.cs
- TextTreeInsertUndoUnit.cs
- TreeViewHitTestInfo.cs
- precedingsibling.cs
- FlatButtonAppearance.cs
- IgnoreSection.cs
- ZoomComboBox.cs
- SoapSchemaExporter.cs
- DummyDataSource.cs
- MethodBuilder.cs
- DeflateEmulationStream.cs
- DSASignatureFormatter.cs
- DataBoundControl.cs
- ProvideValueServiceProvider.cs
- TreeView.cs
- sqlnorm.cs
- CodeMethodInvokeExpression.cs
- DefaultAsyncDataDispatcher.cs
- SchemaTableColumn.cs
- TextEvent.cs
- CodeThrowExceptionStatement.cs
- ReaderWriterLock.cs
- CompilerLocalReference.cs
- CollectionView.cs
- AuthenticateEventArgs.cs
- AnnotationStore.cs
- DesignerContextDescriptor.cs
- SByteConverter.cs
- UrlRoutingHandler.cs
- ObjectPropertyMapping.cs
- ThicknessAnimationBase.cs
- QueryOutputWriter.cs
- SEHException.cs
- XmlSchemaSimpleType.cs
- TextParaLineResult.cs
- ForwardPositionQuery.cs
- IgnorePropertiesAttribute.cs
- RenderDataDrawingContext.cs
- SqlExpander.cs
- Internal.cs
- SpotLight.cs
- SecurityNegotiationException.cs
- SqlDataSourceWizardForm.cs
- ComplexPropertyEntry.cs
- RewritingPass.cs
- BlurBitmapEffect.cs
- PolicyUtility.cs
- VBCodeProvider.cs
- CodePropertyReferenceExpression.cs
- BitmapEffectInputConnector.cs
- ContentPresenter.cs
- WebPartConnectVerb.cs
- BindToObject.cs
- DynamicMethod.cs
- DriveInfo.cs
- XmlImplementation.cs
- Win32.cs
- Query.cs
- ContentType.cs
- PathFigure.cs
- SmiContext.cs