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
- ListChangedEventArgs.cs
- ExitEventArgs.cs
- TextEditor.cs
- DateTimeFormatInfoScanner.cs
- XsdDataContractExporter.cs
- StylusSystemGestureEventArgs.cs
- bindurihelper.cs
- ToolStripOverflowButton.cs
- WebFaultException.cs
- DataReaderContainer.cs
- ProxySimple.cs
- DbUpdateCommandTree.cs
- MatrixAnimationUsingKeyFrames.cs
- ModelPropertyCollectionImpl.cs
- TextSelectionProcessor.cs
- ControlBindingsCollection.cs
- ImpersonateTokenRef.cs
- BitmapDecoder.cs
- DelegatingHeader.cs
- DbSetClause.cs
- Parsers.cs
- ParameterModifier.cs
- NameService.cs
- UpDownEvent.cs
- ImportOptions.cs
- IdnElement.cs
- BufferBuilder.cs
- MediaSystem.cs
- SnapLine.cs
- ComboBoxDesigner.cs
- ResourceFallbackManager.cs
- SQLByte.cs
- CodeAttributeDeclaration.cs
- OneWayChannelFactory.cs
- OleDbPropertySetGuid.cs
- SqlConnectionPoolProviderInfo.cs
- EditorZoneBase.cs
- MSG.cs
- RSAProtectedConfigurationProvider.cs
- XmlCharCheckingWriter.cs
- ToolboxDataAttribute.cs
- SystemIPAddressInformation.cs
- ScriptResourceMapping.cs
- AddressHeader.cs
- BaseCodePageEncoding.cs
- versioninfo.cs
- ArraySegment.cs
- Codec.cs
- UTF32Encoding.cs
- UntypedNullExpression.cs
- PreservationFileReader.cs
- ConnectionStringsExpressionBuilder.cs
- List.cs
- TableRow.cs
- Version.cs
- ObjectSpanRewriter.cs
- SqlDataAdapter.cs
- FontSource.cs
- FramingChannels.cs
- PersonalizableAttribute.cs
- SpellerHighlightLayer.cs
- MobileControlBuilder.cs
- WebContext.cs
- LoginDesignerUtil.cs
- OpenTypeCommon.cs
- DocComment.cs
- TriggerBase.cs
- ClientOptions.cs
- Closure.cs
- RawStylusInputReport.cs
- TransformDescriptor.cs
- DataSourceControlBuilder.cs
- StoreItemCollection.Loader.cs
- MailWriter.cs
- ObjectDisposedException.cs
- UnmanagedMemoryAccessor.cs
- InvalidOleVariantTypeException.cs
- NameValueCollection.cs
- SqlPersonalizationProvider.cs
- AsyncOperation.cs
- FileDataSourceCache.cs
- DataRowView.cs
- TextLineBreak.cs
- XmlDataSourceNodeDescriptor.cs
- _UriSyntax.cs
- securitycriticaldataformultiplegetandset.cs
- Duration.cs
- TextTreeNode.cs
- NativeStructs.cs
- ProfileProvider.cs
- IsolationInterop.cs
- GifBitmapDecoder.cs
- DataBindingHandlerAttribute.cs
- RelatedPropertyManager.cs
- DispatchChannelSink.cs
- ContextBase.cs
- TemplateAction.cs
- Transform3DGroup.cs
- IndexedGlyphRun.cs
- DataGridViewRowPrePaintEventArgs.cs