Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / ResourceExpression.cs / 1305376 / ResourceExpression.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Base class for expressions representing resources
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services.Client
{
#region Namespaces.
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
#endregion Namespaces.
///
/// The counting option for the resource expression
///
internal enum CountOption
{
/// No counting
None,
/// Translates to the $count segment.
ValueOnly,
/// Translates to the $inlinecount=allpages query option
InlineAll
}
///
/// Abstract base class for expressions that support Query Options
///
internal abstract class ResourceExpression : Expression
{
#region Fields.
/// Source expression.
protected readonly Expression source;
/// Singleton InputReferenceExpression that should be used to indicate a reference to this element of the resource path
protected InputReferenceExpression inputRef;
/// expand paths
private List expandPaths;
/// The count query option for the resource set
private CountOption countOption;
/// custom query options
private Dictionary customQueryOptions;
private ProjectionQueryOptionExpression projection;
#endregion Fields.
///
/// Creates a Resource expression
///
/// the return type of the expression
/// The custom query options
/// the expand paths
/// the node type
/// the count option
#pragma warning disable 618
internal ResourceExpression(Expression source, ExpressionType nodeType, Type type, List expandPaths, CountOption countOption, Dictionary customQueryOptions, ProjectionQueryOptionExpression projection)
: base(nodeType, type)
{
this.expandPaths = expandPaths ?? new List();
this.countOption = countOption;
this.customQueryOptions = customQueryOptions ?? new Dictionary(ReferenceEqualityComparer.Instance);
this.projection = projection;
this.source = source;
}
#pragma warning restore 618
abstract internal ResourceExpression CreateCloneWithNewType(Type type);
abstract internal bool HasQueryOptions { get; }
///
/// Resource type for this expression (for sets, this is the element type).
/// Never null.
///
internal abstract Type ResourceType { get; }
///
/// Does this expression produce at most 1 resource?
///
abstract internal bool IsSingleton { get; }
///
/// Expand query option for ResourceSet
///
internal virtual List ExpandPaths
{
get { return this.expandPaths; }
set { this.expandPaths = value; }
}
///
/// Count query option for ResourceSet
///
internal virtual CountOption CountOption
{
get { return this.countOption; }
set { this.countOption = value; }
}
///
/// custom query options for ResourceSet
///
internal virtual Dictionary CustomQueryOptions
{
get { return this.customQueryOptions; }
set { this.customQueryOptions = value; }
}
/// Description of the projection on a resource.
///
/// This property is set by the ProjectionAnalyzer component (so it
/// mutates this instance), or by the ResourceBinder when it clones
/// a ResourceExpression.
///
internal ProjectionQueryOptionExpression Projection
{
get { return this.projection; }
set { this.projection = value; }
}
///
/// Gets the source expression.
///
internal Expression Source
{
get
{
return this.source;
}
}
///
/// Creates an that refers to this component of the resource path.
/// The returned expression is guaranteed to be reference-equal (object.ReferenceEquals)
/// to any other InputReferenceExpression that also refers to this resource path component.
///
/// The InputReferenceExpression that refers to this resource path component
internal InputReferenceExpression CreateReference()
{
if (this.inputRef == null)
{
this.inputRef = new InputReferenceExpression(this);
}
return this.inputRef;
}
}
}
// 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
- BitmapInitialize.cs
- EncodingDataItem.cs
- SemaphoreSecurity.cs
- BuildProviderUtils.cs
- StringFormat.cs
- ComponentConverter.cs
- Utils.cs
- EntityDataSourceReferenceGroup.cs
- FrameworkName.cs
- HtmlInputCheckBox.cs
- ScriptingSectionGroup.cs
- PackageProperties.cs
- EventMap.cs
- AdornerLayer.cs
- ExeConfigurationFileMap.cs
- InputScope.cs
- ImageButton.cs
- DatePicker.cs
- StringAnimationBase.cs
- PriorityChain.cs
- BulletDecorator.cs
- CustomErrorCollection.cs
- ThemeDictionaryExtension.cs
- CharAnimationBase.cs
- HtmlControlPersistable.cs
- UnsafeNetInfoNativeMethods.cs
- AssemblyAttributesGoHere.cs
- InkCanvas.cs
- Point.cs
- SqlNotificationEventArgs.cs
- EventBuilder.cs
- ParseNumbers.cs
- UnSafeCharBuffer.cs
- WebUtil.cs
- ConfigurationProperty.cs
- remotingproxy.cs
- LeafCellTreeNode.cs
- LeafCellTreeNode.cs
- BaseDataListPage.cs
- PassportAuthentication.cs
- SqlDataSourceConfigureSelectPanel.cs
- SystemInformation.cs
- DecimalConverter.cs
- PerspectiveCamera.cs
- StrongNameIdentityPermission.cs
- CroppedBitmap.cs
- TypeConverterHelper.cs
- AnnouncementEndpoint.cs
- EmptyEnumerator.cs
- SharedStatics.cs
- LayoutTableCell.cs
- WebPartDisplayModeCollection.cs
- Win32Native.cs
- WebPartAddingEventArgs.cs
- SafeViewOfFileHandle.cs
- FixedFindEngine.cs
- VersionedStream.cs
- PEFileReader.cs
- CompModHelpers.cs
- UnsafeNativeMethods.cs
- SecurityDocument.cs
- ZipIORawDataFileBlock.cs
- Timer.cs
- NetworkCredential.cs
- SuppressMergeCheckAttribute.cs
- DataTableMappingCollection.cs
- CodeIndexerExpression.cs
- GridViewItemAutomationPeer.cs
- Camera.cs
- Funcletizer.cs
- SafeNativeMethodsMilCoreApi.cs
- StoreAnnotationsMap.cs
- SqlDependencyUtils.cs
- ResourceProviderFactory.cs
- WindowPatternIdentifiers.cs
- DiagnosticsElement.cs
- XmlSerializationReader.cs
- PrivilegedConfigurationManager.cs
- PrimaryKeyTypeConverter.cs
- DriveNotFoundException.cs
- ApplicationTrust.cs
- MaskedTextBox.cs
- LazyInitializer.cs
- ObjectContext.cs
- StringValidatorAttribute.cs
- EventRouteFactory.cs
- SoapAttributeOverrides.cs
- cookiecontainer.cs
- DataObjectPastingEventArgs.cs
- ZipIOLocalFileHeader.cs
- BaseAppDomainProtocolHandler.cs
- WindowsTitleBar.cs
- Region.cs
- ReachPageContentSerializer.cs
- ObjectResult.cs
- MemoryRecordBuffer.cs
- ContextStaticAttribute.cs
- OrthographicCamera.cs
- CssClassPropertyAttribute.cs
- StyleSheetDesigner.cs