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
- ListViewDataItem.cs
- PhonemeEventArgs.cs
- ObjectListCommand.cs
- SHA256CryptoServiceProvider.cs
- CollectionChangedEventManager.cs
- SynchronizedPool.cs
- WebPartZoneCollection.cs
- WebScriptServiceHostFactory.cs
- CompilerResults.cs
- WmlObjectListAdapter.cs
- DesignTimeValidationFeature.cs
- TreeNode.cs
- Stroke2.cs
- CounterCreationData.cs
- TextElementCollection.cs
- MatrixCamera.cs
- AlternateViewCollection.cs
- SystemIPv4InterfaceProperties.cs
- XamlTemplateSerializer.cs
- log.cs
- SessionStateSection.cs
- CompiledXpathExpr.cs
- ChangeConflicts.cs
- MailAddressCollection.cs
- PathTooLongException.cs
- ResourceWriter.cs
- ISAPIWorkerRequest.cs
- NonSerializedAttribute.cs
- Quaternion.cs
- HttpProfileBase.cs
- XmlSchemaInclude.cs
- PeerObject.cs
- RijndaelCryptoServiceProvider.cs
- ProgramNode.cs
- MimeAnyImporter.cs
- StyleXamlTreeBuilder.cs
- RenamedEventArgs.cs
- ComboBoxRenderer.cs
- ValidatorCompatibilityHelper.cs
- State.cs
- ObjectPersistData.cs
- _SpnDictionary.cs
- StringAttributeCollection.cs
- ControlPaint.cs
- PersistChildrenAttribute.cs
- InputGestureCollection.cs
- TabControl.cs
- QilSortKey.cs
- XmlILConstructAnalyzer.cs
- FormViewPagerRow.cs
- DbConnectionClosed.cs
- PropertySegmentSerializationProvider.cs
- NativeMethods.cs
- EncoderFallback.cs
- FrameworkTextComposition.cs
- Vector3DConverter.cs
- HttpApplication.cs
- Vector3DValueSerializer.cs
- BackgroundWorker.cs
- PropertyNames.cs
- _SslStream.cs
- SafeUserTokenHandle.cs
- StateChangeEvent.cs
- Brush.cs
- Transform3D.cs
- CodeMemberField.cs
- DiscoveryClientDocuments.cs
- InvalidProgramException.cs
- ToolStripDropDownItem.cs
- DataGridColumnCollection.cs
- CodeNamespaceCollection.cs
- ObjectDisposedException.cs
- WebPartManager.cs
- StrokeRenderer.cs
- SID.cs
- DataRelationCollection.cs
- LaxModeSecurityHeaderElementInferenceEngine.cs
- EdmFunctions.cs
- SqlBulkCopyColumnMapping.cs
- InstanceCollisionException.cs
- AuthenticatedStream.cs
- MaxSessionCountExceededException.cs
- DBAsyncResult.cs
- WindowClosedEventArgs.cs
- EndpointConfigContainer.cs
- CompilerParameters.cs
- ProfileEventArgs.cs
- TreeNode.cs
- RolePrincipal.cs
- EntityContainer.cs
- StorageEntityContainerMapping.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- CodeSubDirectoriesCollection.cs
- TraceHandlerErrorFormatter.cs
- RelationHandler.cs
- SerializationSectionGroup.cs
- EntityCommandDefinition.cs
- _NegoState.cs
- QilScopedVisitor.cs
- EntityType.cs