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
- HTMLTagNameToTypeMapper.cs
- InstanceOwnerQueryResult.cs
- RealizationContext.cs
- SoapAttributeAttribute.cs
- NamespaceInfo.cs
- HiddenFieldPageStatePersister.cs
- DbParameterHelper.cs
- unsafenativemethodsother.cs
- MetadataItem_Static.cs
- DataFormats.cs
- AliasedSlot.cs
- NativeMethods.cs
- PageHandlerFactory.cs
- StylusPlugInCollection.cs
- WindowsMenu.cs
- Span.cs
- ScriptReference.cs
- XmlMapping.cs
- ApplicationBuildProvider.cs
- ButtonField.cs
- GlyphRunDrawing.cs
- SystemIPGlobalStatistics.cs
- RegexWorker.cs
- ImmComposition.cs
- ProxyHelper.cs
- Translator.cs
- TaskFactory.cs
- ScrollProviderWrapper.cs
- Underline.cs
- HwndSubclass.cs
- HttpMethodAttribute.cs
- BaseDataList.cs
- InheritanceAttribute.cs
- HtmlShimManager.cs
- ImportDesigner.xaml.cs
- ServiceModelReg.cs
- IndexedEnumerable.cs
- AbstractDataSvcMapFileLoader.cs
- WorkflowRuntimeElement.cs
- ManagementEventArgs.cs
- ScriptDescriptor.cs
- DataGridItemAttachedStorage.cs
- BamlRecordHelper.cs
- DateTimeConstantAttribute.cs
- ResourcesBuildProvider.cs
- StringToken.cs
- StylusPointPropertyInfo.cs
- ProcessDesigner.cs
- CompositeFontParser.cs
- MetadataItem_Static.cs
- FilteredXmlReader.cs
- DataServiceHostWrapper.cs
- CFStream.cs
- TryCatchDesigner.xaml.cs
- InlinedAggregationOperatorEnumerator.cs
- InfoCardSymmetricAlgorithm.cs
- SQLDecimalStorage.cs
- TransportContext.cs
- Control.cs
- CacheSection.cs
- OleDbWrapper.cs
- XmlSchemaImport.cs
- MenuBase.cs
- TriggerCollection.cs
- PtsHelper.cs
- DictionaryGlobals.cs
- UmAlQuraCalendar.cs
- HttpApplicationStateWrapper.cs
- Mappings.cs
- DataObjectSettingDataEventArgs.cs
- ProxyWebPart.cs
- DocComment.cs
- FontStretches.cs
- OutputChannel.cs
- SchemaNames.cs
- SplineKeyFrames.cs
- UrlPropertyAttribute.cs
- PipelineComponent.cs
- InvalidWorkflowException.cs
- ProviderBase.cs
- HandlerFactoryCache.cs
- DataFormat.cs
- SpeakInfo.cs
- ViewManagerAttribute.cs
- DateTimeFormat.cs
- TemplateKey.cs
- BindingExpression.cs
- GradientSpreadMethodValidation.cs
- HTTPNotFoundHandler.cs
- Literal.cs
- WebPageTraceListener.cs
- ReadOnlyAttribute.cs
- FilteredSchemaElementLookUpTable.cs
- SuppressMergeCheckAttribute.cs
- xmlformatgeneratorstatics.cs
- Vector.cs
- WebPartDisplayModeEventArgs.cs
- ToolStripGrip.cs
- ExpressionConverter.cs
- StringFreezingAttribute.cs