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
- XmlSchemas.cs
- DataControlField.cs
- StorageComplexTypeMapping.cs
- BinaryNode.cs
- GridViewDeleteEventArgs.cs
- DataGridViewButtonCell.cs
- cookiecollection.cs
- WebPartChrome.cs
- TemplateBindingExpression.cs
- TypeToken.cs
- SendOperation.cs
- WindowShowOrOpenTracker.cs
- SqlGenerator.cs
- CustomErrorCollection.cs
- PerformanceCounterManager.cs
- ProcessHostServerConfig.cs
- WindowsToolbarAsMenu.cs
- HwndProxyElementProvider.cs
- FunctionQuery.cs
- FamilyMap.cs
- MetadataItemCollectionFactory.cs
- VectorAnimation.cs
- HwndHostAutomationPeer.cs
- DrawingContextDrawingContextWalker.cs
- DesignerVerbCollection.cs
- OpacityConverter.cs
- __FastResourceComparer.cs
- StringDictionaryWithComparer.cs
- WebConfigurationHostFileChange.cs
- AsymmetricKeyExchangeFormatter.cs
- DataServiceResponse.cs
- UnauthorizedAccessException.cs
- ToolStripContentPanel.cs
- Renderer.cs
- WebRequestModuleElement.cs
- DataGridSortCommandEventArgs.cs
- CurrencyManager.cs
- SapiGrammar.cs
- StateChangeEvent.cs
- ToolStripDropDownClosingEventArgs.cs
- LogPolicy.cs
- HuffCodec.cs
- ColumnTypeConverter.cs
- CookieProtection.cs
- AssemblyBuilder.cs
- GradientStop.cs
- configsystem.cs
- PropertiesTab.cs
- SatelliteContractVersionAttribute.cs
- ClientProxyGenerator.cs
- Scheduler.cs
- PasswordBoxAutomationPeer.cs
- mactripleDES.cs
- ILGen.cs
- TranslateTransform3D.cs
- TreeNodeStyle.cs
- ellipse.cs
- HtmlUtf8RawTextWriter.cs
- TransformCryptoHandle.cs
- Brushes.cs
- CatalogZone.cs
- FileVersionInfo.cs
- FormViewInsertedEventArgs.cs
- EpmCustomContentSerializer.cs
- PointHitTestResult.cs
- QueryStatement.cs
- FlowThrottle.cs
- TextServicesCompartment.cs
- BasePattern.cs
- HttpListenerException.cs
- DrawListViewSubItemEventArgs.cs
- AssemblyAttributesGoHere.cs
- XmlAttributeProperties.cs
- ContextMenu.cs
- NetStream.cs
- ViewDesigner.cs
- SafeProcessHandle.cs
- ZipIOCentralDirectoryBlock.cs
- TreeViewItem.cs
- TriggerCollection.cs
- DocComment.cs
- EventWaitHandleSecurity.cs
- SessionStateItemCollection.cs
- MutexSecurity.cs
- WorkerRequest.cs
- AsyncDataRequest.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- MediaTimeline.cs
- ToolStripSeparator.cs
- SoapSchemaImporter.cs
- NamespaceDecl.cs
- SettingsProperty.cs
- ParameterCollection.cs
- HtmlInputImage.cs
- DockingAttribute.cs
- MobileUserControlDesigner.cs
- ColorKeyFrameCollection.cs
- Monitor.cs
- MediaScriptCommandRoutedEventArgs.cs
- DeviceContext.cs