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 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
- xmlformatgeneratorstatics.cs
- HtmlTernaryTree.cs
- ToggleButtonAutomationPeer.cs
- PropertyFilter.cs
- UnmanagedBitmapWrapper.cs
- ScrollChrome.cs
- NonPrimarySelectionGlyph.cs
- PeerObject.cs
- BufferedWebEventProvider.cs
- Zone.cs
- DBCSCodePageEncoding.cs
- PackageRelationshipCollection.cs
- TextHidden.cs
- Brush.cs
- AsyncPostBackErrorEventArgs.cs
- TreeBuilder.cs
- WindowsButton.cs
- X509WindowsSecurityToken.cs
- TypeBrowser.xaml.cs
- SatelliteContractVersionAttribute.cs
- QilStrConcat.cs
- TextTreeTextBlock.cs
- XmlSerializerSection.cs
- GradientStop.cs
- ClientSection.cs
- TextPointer.cs
- HebrewCalendar.cs
- ParseElement.cs
- DockProviderWrapper.cs
- TemplateControl.cs
- GridViewSortEventArgs.cs
- ListViewInsertedEventArgs.cs
- LineMetrics.cs
- COM2PropertyBuilderUITypeEditor.cs
- StringValueConverter.cs
- DecoderExceptionFallback.cs
- InOutArgumentConverter.cs
- TemplatedMailWebEventProvider.cs
- DataServiceRequestOfT.cs
- FlatButtonAppearance.cs
- TemplateComponentConnector.cs
- CompositeDataBoundControl.cs
- BrowserCapabilitiesCodeGenerator.cs
- DiscreteKeyFrames.cs
- Int16Converter.cs
- PrintDialog.cs
- BasicCommandTreeVisitor.cs
- XmlSerializerSection.cs
- KernelTypeValidation.cs
- DataKeyPropertyAttribute.cs
- CodeDirectiveCollection.cs
- UserPersonalizationStateInfo.cs
- CommonDialog.cs
- XmlAttributeProperties.cs
- NodeLabelEditEvent.cs
- AsymmetricKeyExchangeFormatter.cs
- ToolBarOverflowPanel.cs
- PrimitiveList.cs
- ConcurrencyMode.cs
- BeginEvent.cs
- UnaryNode.cs
- TimeoutConverter.cs
- PageStatePersister.cs
- HttpConfigurationSystem.cs
- CodeBinaryOperatorExpression.cs
- SchemaManager.cs
- UserControlAutomationPeer.cs
- DataGridViewDesigner.cs
- SourceInterpreter.cs
- TileModeValidation.cs
- StylusTip.cs
- ScrollContentPresenter.cs
- InputGestureCollection.cs
- XmlSchemaDatatype.cs
- TextPattern.cs
- XmlRawWriterWrapper.cs
- WebPartDeleteVerb.cs
- CodeLinePragma.cs
- BinHexEncoding.cs
- Span.cs
- TextEditorThreadLocalStore.cs
- PropertyToken.cs
- OrderedDictionary.cs
- MimeTypeMapper.cs
- TypeKeyValue.cs
- TreeNodeCollection.cs
- CategoryList.cs
- GeneralTransform2DTo3DTo2D.cs
- ParsedRoute.cs
- PageSettings.cs
- SymmetricKeyWrap.cs
- RequestCache.cs
- LayoutEvent.cs
- PenContexts.cs
- RijndaelCryptoServiceProvider.cs
- DecimalMinMaxAggregationOperator.cs
- ZipIOExtraFieldPaddingElement.cs
- EventlogProvider.cs
- GetPageNumberCompletedEventArgs.cs
- HelpKeywordAttribute.cs