Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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 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
- TransactionFlowOption.cs
- DesignerWidgets.cs
- ResourceDisplayNameAttribute.cs
- String.cs
- CapabilitiesState.cs
- DetailsViewModeEventArgs.cs
- RuntimeHelpers.cs
- SortKey.cs
- CodeMethodReturnStatement.cs
- HTMLTagNameToTypeMapper.cs
- ScriptServiceAttribute.cs
- QueueTransferProtocol.cs
- ParseElement.cs
- AttributeEmitter.cs
- XmlConvert.cs
- BamlResourceContent.cs
- Keyboard.cs
- TextElement.cs
- JumpPath.cs
- HyperLinkField.cs
- GridViewPageEventArgs.cs
- _LoggingObject.cs
- BufferBuilder.cs
- XmlExtensionFunction.cs
- SafeRightsManagementQueryHandle.cs
- DataError.cs
- ObjectConverter.cs
- Rotation3DKeyFrameCollection.cs
- HoistedLocals.cs
- ServicePointManager.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- _LocalDataStoreMgr.cs
- ReachPageContentCollectionSerializerAsync.cs
- Registry.cs
- ConfigurationPropertyAttribute.cs
- RangeValidator.cs
- DataGridViewRowEventArgs.cs
- EncoderBestFitFallback.cs
- RoleService.cs
- AttachInfo.cs
- TypeLoadException.cs
- LinqDataSourceView.cs
- DataGridViewCellValidatingEventArgs.cs
- PerformanceCounterManager.cs
- Type.cs
- DataGridViewBindingCompleteEventArgs.cs
- CheckBoxRenderer.cs
- Tokenizer.cs
- NumericUpDownAccelerationCollection.cs
- EraserBehavior.cs
- FloatUtil.cs
- CultureTable.cs
- DropShadowEffect.cs
- WmlCalendarAdapter.cs
- BufferBuilder.cs
- XmlAtomicValue.cs
- UriExt.cs
- SubordinateTransaction.cs
- HtmlShimManager.cs
- DocumentViewerBase.cs
- SqlNodeAnnotations.cs
- UndirectedGraph.cs
- Action.cs
- GifBitmapDecoder.cs
- CacheMemory.cs
- TemplateControl.cs
- RoutedCommand.cs
- WebPartConnectVerb.cs
- DivideByZeroException.cs
- SHA256Managed.cs
- SafeArrayRankMismatchException.cs
- _NegoState.cs
- BitmapMetadata.cs
- AssemblyBuilder.cs
- SoapHttpTransportImporter.cs
- QueuePropertyVariants.cs
- SystemIPGlobalStatistics.cs
- OleDbDataAdapter.cs
- XsltInput.cs
- DataGridViewSelectedCellCollection.cs
- ListSourceHelper.cs
- InstanceOwnerException.cs
- NameGenerator.cs
- WindowsGraphics2.cs
- Image.cs
- RtType.cs
- XMLSchema.cs
- AccessedThroughPropertyAttribute.cs
- ReadOnlyDictionary.cs
- ClientSettingsProvider.cs
- Model3DGroup.cs
- SelectionUIHandler.cs
- WebPartEditVerb.cs
- FontStyles.cs
- DataFieldEditor.cs
- XmlSchemaChoice.cs
- HttpWebRequest.cs
- QueryTaskGroupState.cs
- PieceNameHelper.cs
- DbParameterHelper.cs