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 expression with this one.
///
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.
//----------------------------------------------------------------------
//
// 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 expression with this one.
///
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContainerAction.cs
- SpotLight.cs
- MexNamedPipeBindingElement.cs
- AssociationSetEnd.cs
- FileEnumerator.cs
- WebHttpEndpointElement.cs
- FixUp.cs
- EncoderExceptionFallback.cs
- StrongNamePublicKeyBlob.cs
- RowVisual.cs
- HttpsHostedTransportConfiguration.cs
- XPathAncestorQuery.cs
- WebControlsSection.cs
- NamespaceDecl.cs
- Part.cs
- RIPEMD160Managed.cs
- mediaclock.cs
- ImpersonationContext.cs
- ConfigXmlElement.cs
- PenContexts.cs
- RightsManagementEncryptedStream.cs
- ToolboxBitmapAttribute.cs
- TextMessageEncodingElement.cs
- PropertyPathWorker.cs
- VirtualPath.cs
- QuaternionRotation3D.cs
- FontEmbeddingManager.cs
- InputLanguageSource.cs
- CryptoStream.cs
- ComponentConverter.cs
- XslCompiledTransform.cs
- ImageMapEventArgs.cs
- AxisAngleRotation3D.cs
- DESCryptoServiceProvider.cs
- WebPartDisplayMode.cs
- DiscardableAttribute.cs
- MdiWindowListStrip.cs
- SystemException.cs
- CfgParser.cs
- Style.cs
- PrePostDescendentsWalker.cs
- WebHttpDispatchOperationSelector.cs
- DbConnectionPool.cs
- FontSourceCollection.cs
- HtmlInputCheckBox.cs
- CategoryNameCollection.cs
- DrawingAttributeSerializer.cs
- DbProviderServices.cs
- EntityDataSourceValidationException.cs
- DesignTimeValidationFeature.cs
- HopperCache.cs
- DependencyPropertyValueSerializer.cs
- PermissionSetTriple.cs
- EventInfo.cs
- _ProxyRegBlob.cs
- Compiler.cs
- PropertyKey.cs
- DataGrid.cs
- SqlNotificationRequest.cs
- CheckBoxField.cs
- CellParagraph.cs
- WebAdminConfigurationHelper.cs
- UniformGrid.cs
- _RegBlobWebProxyDataBuilder.cs
- DoubleCollectionConverter.cs
- UriScheme.cs
- UInt16.cs
- ListControlBoundActionList.cs
- TopClause.cs
- ScriptReferenceEventArgs.cs
- RowParagraph.cs
- BordersPage.cs
- ServiceOperation.cs
- Property.cs
- ToolConsole.cs
- LinqDataSourceDisposeEventArgs.cs
- TemplateField.cs
- SessionEndingCancelEventArgs.cs
- XPathChildIterator.cs
- KoreanCalendar.cs
- MsmqHostedTransportManager.cs
- WS2007FederationHttpBinding.cs
- ApplicationServiceHelper.cs
- BitmapPalettes.cs
- XmlWhitespace.cs
- Label.cs
- SchemaTypeEmitter.cs
- ellipse.cs
- COM2EnumConverter.cs
- RegexInterpreter.cs
- PropertyChangingEventArgs.cs
- ConnectivityStatus.cs
- ControlTemplate.cs
- LayoutSettings.cs
- PolygonHotSpot.cs
- RuleRefElement.cs
- KnowledgeBase.cs
- TextFormatter.cs
- WindowsProgressbar.cs
- ChildrenQuery.cs