Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ExpressionVisitorHelpers.cs / 1 / ExpressionVisitorHelpers.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Data;
namespace System.Linq.Expressions
{
// Because we are using the source file for ExpressionVistor from System.Core
// we need to add code to facilitate some external calls that ExpressionVisitor makes.
// The classes in this file do that.
internal static class Error
{
internal static Exception UnhandledExpressionType(ExpressionType expressionType)
{
return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledExpressionType(expressionType));
}
internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
{
return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledBindingType(memberBindingType));
}
}
internal static class ReadOnlyCollectionExtensions
{
internal static ReadOnlyCollection ToReadOnlyCollection(this IEnumerable sequence)
{
if (sequence == null)
return DefaultReadOnlyCollection.Empty;
ReadOnlyCollection col = sequence as ReadOnlyCollection;
if (col != null)
return col;
return new ReadOnlyCollection(sequence.ToArray());
}
private static class DefaultReadOnlyCollection
{
private static ReadOnlyCollection _defaultCollection;
internal static ReadOnlyCollection Empty
{
get
{
if (_defaultCollection == null)
_defaultCollection = new ReadOnlyCollection(new T[] { });
return _defaultCollection;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Data;
namespace System.Linq.Expressions
{
// Because we are using the source file for ExpressionVistor from System.Core
// we need to add code to facilitate some external calls that ExpressionVisitor makes.
// The classes in this file do that.
internal static class Error
{
internal static Exception UnhandledExpressionType(ExpressionType expressionType)
{
return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledExpressionType(expressionType));
}
internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
{
return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledBindingType(memberBindingType));
}
}
internal static class ReadOnlyCollectionExtensions
{
internal static ReadOnlyCollection ToReadOnlyCollection(this IEnumerable sequence)
{
if (sequence == null)
return DefaultReadOnlyCollection.Empty;
ReadOnlyCollection col = sequence as ReadOnlyCollection;
if (col != null)
return col;
return new ReadOnlyCollection(sequence.ToArray());
}
private static class DefaultReadOnlyCollection
{
private static ReadOnlyCollection _defaultCollection;
internal static ReadOnlyCollection Empty
{
get
{
if (_defaultCollection == null)
_defaultCollection = new ReadOnlyCollection(new T[] { });
return _defaultCollection;
}
}
}
}
}
// 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
- CodeEventReferenceExpression.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DefaultValueConverter.cs
- DecoderFallback.cs
- TypeConverterBase.cs
- ToolStripMenuItem.cs
- HttpWebRequestElement.cs
- OletxTransactionManager.cs
- SplineQuaternionKeyFrame.cs
- ProgressBarBrushConverter.cs
- InheritablePropertyChangeInfo.cs
- DesignTimeParseData.cs
- Type.cs
- ScriptResourceAttribute.cs
- PropVariant.cs
- AbstractDataSvcMapFileLoader.cs
- MarshalByRefObject.cs
- RelationshipType.cs
- AsyncOperationManager.cs
- OletxTransactionFormatter.cs
- LeaseManager.cs
- MonthCalendar.cs
- SimpleApplicationHost.cs
- IPipelineRuntime.cs
- TextTreeUndo.cs
- DataStreamFromComStream.cs
- CodeIdentifier.cs
- NullableDecimalMinMaxAggregationOperator.cs
- OdbcConnectionPoolProviderInfo.cs
- LinearKeyFrames.cs
- SystemDropShadowChrome.cs
- Root.cs
- HttpRuntime.cs
- GetPageNumberCompletedEventArgs.cs
- ObjectAnimationUsingKeyFrames.cs
- AdvancedBindingEditor.cs
- Container.cs
- PrimarySelectionGlyph.cs
- LoginCancelEventArgs.cs
- safePerfProviderHandle.cs
- DataGridViewTopLeftHeaderCell.cs
- MatrixCamera.cs
- InplaceBitmapMetadataWriter.cs
- InputLanguageManager.cs
- messageonlyhwndwrapper.cs
- EventData.cs
- WindowsFormsSectionHandler.cs
- FormDesigner.cs
- ADMembershipUser.cs
- VersionedStreamOwner.cs
- SynchronizedRandom.cs
- DbConvert.cs
- WorkflowPageSetupDialog.cs
- KeyTimeConverter.cs
- WindowsTokenRoleProvider.cs
- CriticalFinalizerObject.cs
- HttpDictionary.cs
- VerticalConnector.xaml.cs
- Error.cs
- FileBasedResourceGroveler.cs
- ProfileParameter.cs
- DynamicPropertyHolder.cs
- InstanceDataCollection.cs
- XsdDataContractExporter.cs
- mansign.cs
- SiteIdentityPermission.cs
- FormViewModeEventArgs.cs
- SiteMapPathDesigner.cs
- PerformanceCounterLib.cs
- InternalsVisibleToAttribute.cs
- Control.cs
- VerbConverter.cs
- BevelBitmapEffect.cs
- SoapSchemaMember.cs
- ActivityValidator.cs
- Expander.cs
- ComponentSerializationService.cs
- FixedSOMImage.cs
- XmlnsPrefixAttribute.cs
- SqlStatistics.cs
- Drawing.cs
- ISessionStateStore.cs
- GPStream.cs
- GroupStyle.cs
- ShapingWorkspace.cs
- MbpInfo.cs
- EditorPart.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- parserscommon.cs
- RuntimeComponentFilter.cs
- SharedPersonalizationStateInfo.cs
- ImageAutomationPeer.cs
- TextEndOfLine.cs
- WindowHideOrCloseTracker.cs
- PlatformNotSupportedException.cs
- ClientConfigurationHost.cs
- ToolboxBitmapAttribute.cs
- XmlSchemaSubstitutionGroup.cs
- InputLanguageProfileNotifySink.cs
- Exceptions.cs