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
- WsdlInspector.cs
- WindowVisualStateTracker.cs
- UInt32.cs
- Brush.cs
- ResolveNameEventArgs.cs
- CheckBox.cs
- ProxyGenerationError.cs
- MessageDesigner.cs
- Point.cs
- TrackBarRenderer.cs
- NavigationHelper.cs
- RegisteredArrayDeclaration.cs
- ArraySubsetEnumerator.cs
- PipeStream.cs
- PackageProperties.cs
- LineSegment.cs
- SynchronizingStream.cs
- TextStore.cs
- RelatedEnd.cs
- LogicalExpressionEditor.cs
- StylusButtonCollection.cs
- AssociationEndMember.cs
- DoWhile.cs
- StrokeCollectionConverter.cs
- WebPartCloseVerb.cs
- ToolboxItemWrapper.cs
- HiddenFieldDesigner.cs
- PerfCounters.cs
- printdlgexmarshaler.cs
- ToolStripPanelCell.cs
- ComplexBindingPropertiesAttribute.cs
- XPathNodeIterator.cs
- TextRunCache.cs
- Transaction.cs
- XmlTextReaderImplHelpers.cs
- ClientBuildManager.cs
- ArrayList.cs
- CodeIdentifiers.cs
- Matrix3DValueSerializer.cs
- MoveSizeWinEventHandler.cs
- UpdateTranslator.cs
- PersonalizationProviderHelper.cs
- MobileListItemCollection.cs
- HashMembershipCondition.cs
- SecureStringHasher.cs
- SharedStatics.cs
- CellQuery.cs
- TimeSpanFormat.cs
- EdmProviderManifest.cs
- IERequestCache.cs
- GenericPrincipal.cs
- DuplicateWaitObjectException.cs
- ConfigurationSettings.cs
- MemberDescriptor.cs
- HttpCacheParams.cs
- EventLogEntryCollection.cs
- COM2TypeInfoProcessor.cs
- ETagAttribute.cs
- ReliableSessionBindingElement.cs
- VisualBasicSettingsHandler.cs
- ManagementPath.cs
- PermissionToken.cs
- WizardForm.cs
- MissingFieldException.cs
- XamlPointCollectionSerializer.cs
- SqlCachedBuffer.cs
- MsmqMessage.cs
- FlowDocumentView.cs
- DefaultBindingPropertyAttribute.cs
- COM2IPerPropertyBrowsingHandler.cs
- HtmlDocument.cs
- WmfPlaceableFileHeader.cs
- FreezableOperations.cs
- AssemblyName.cs
- SingleStorage.cs
- ReadOnlyTernaryTree.cs
- ToolStripManager.cs
- MULTI_QI.cs
- VideoDrawing.cs
- CryptoStream.cs
- SerializationObjectManager.cs
- VisualCollection.cs
- QuaternionRotation3D.cs
- SqlConnectionFactory.cs
- AppDomainFactory.cs
- basecomparevalidator.cs
- MonikerBuilder.cs
- SqlCaseSimplifier.cs
- WebMessageFormatHelper.cs
- UserValidatedEventArgs.cs
- ApplyTemplatesAction.cs
- Accessors.cs
- webproxy.cs
- ScriptControl.cs
- Point3D.cs
- ExeContext.cs
- ControlCachePolicy.cs
- serverconfig.cs
- SaveWorkflowAsyncResult.cs
- SecurityTokenAttachmentMode.cs