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
- ToolStripDropDownButton.cs
- RootNamespaceAttribute.cs
- GraphicsState.cs
- DurableOperationContext.cs
- DataGridViewColumn.cs
- ScrollItemPattern.cs
- AdRotator.cs
- TypedTableBaseExtensions.cs
- InputElement.cs
- ContentType.cs
- ColorMap.cs
- AdornerDecorator.cs
- RepeatEnumerable.cs
- ActiveXHost.cs
- ComplexLine.cs
- MultiBindingExpression.cs
- WorkItem.cs
- StringInfo.cs
- SqlGenerator.cs
- DoubleLinkList.cs
- Span.cs
- ScrollItemPattern.cs
- FormDesigner.cs
- NumberFormatInfo.cs
- XPathNode.cs
- UserControlParser.cs
- InputBuffer.cs
- GZipDecoder.cs
- StrongNamePublicKeyBlob.cs
- GlyphRunDrawing.cs
- NullableDoubleSumAggregationOperator.cs
- _AcceptOverlappedAsyncResult.cs
- OracleMonthSpan.cs
- TextMetrics.cs
- EventLogger.cs
- DataGridBeginningEditEventArgs.cs
- Label.cs
- FieldBuilder.cs
- SystemWebExtensionsSectionGroup.cs
- SoapHttpTransportImporter.cs
- SynchronizedDisposablePool.cs
- BCLDebug.cs
- BitmapFrameEncode.cs
- OleDbFactory.cs
- ActivityTrace.cs
- CompilerTypeWithParams.cs
- DataGridViewCellPaintingEventArgs.cs
- CompilerErrorCollection.cs
- Control.cs
- ListDictionaryInternal.cs
- BehaviorEditorPart.cs
- Logging.cs
- XmlSortKey.cs
- OLEDB_Enum.cs
- TextEffect.cs
- Mutex.cs
- DesignBindingPropertyDescriptor.cs
- FormsAuthenticationEventArgs.cs
- InputScope.cs
- DocumentXPathNavigator.cs
- WSHttpBinding.cs
- Configuration.cs
- ComboBoxDesigner.cs
- ListParaClient.cs
- InternalBase.cs
- StylusPointCollection.cs
- SqlDependencyListener.cs
- UIElement.cs
- EntityContainer.cs
- MessageQueuePermissionEntryCollection.cs
- codemethodreferenceexpression.cs
- DrawingState.cs
- ValuePattern.cs
- StringFunctions.cs
- ProcessThread.cs
- XmlCharCheckingWriter.cs
- UpdateManifestForBrowserApplication.cs
- ServiceSecurityAuditBehavior.cs
- DbProviderConfigurationHandler.cs
- DetailsViewCommandEventArgs.cs
- MetafileHeaderEmf.cs
- ToolStripOverflow.cs
- DoubleStorage.cs
- TypeUtil.cs
- TextServicesContext.cs
- AncestorChangedEventArgs.cs
- QilDataSource.cs
- TransformGroup.cs
- TrayIconDesigner.cs
- DataGridBoolColumn.cs
- CodeCommentStatementCollection.cs
- ProxyHelper.cs
- AppearanceEditorPart.cs
- ActivityWithResult.cs
- SimpleType.cs
- PictureBoxDesigner.cs
- UshortList2.cs
- DiscoveryClientDocuments.cs
- WebPartCancelEventArgs.cs
- BoolExpr.cs