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
- RangeValuePatternIdentifiers.cs
- CellConstant.cs
- Brush.cs
- LinqDataSource.cs
- EntityDesignPluralizationHandler.cs
- XmlSchemaAttributeGroup.cs
- FormViewDeletedEventArgs.cs
- OdbcParameterCollection.cs
- Propagator.JoinPropagator.cs
- NonSerializedAttribute.cs
- HScrollProperties.cs
- HttpCookie.cs
- HierarchicalDataBoundControl.cs
- GenericTypeParameterBuilder.cs
- HtmlEmptyTagControlBuilder.cs
- GridToolTip.cs
- TreeBuilderBamlTranslator.cs
- ValueProviderWrapper.cs
- EntityClientCacheKey.cs
- RemotingConfigParser.cs
- MimeParameterWriter.cs
- CustomExpressionEventArgs.cs
- TextRenderer.cs
- WorkflowPrinting.cs
- SchemaInfo.cs
- SpellerHighlightLayer.cs
- SiteMapNodeItem.cs
- StorageEntityContainerMapping.cs
- WizardSideBarListControlItemEventArgs.cs
- DoubleAnimationBase.cs
- ToolStripPanelSelectionBehavior.cs
- SerializationInfo.cs
- WeakEventManager.cs
- ProvidersHelper.cs
- ResourceSetExpression.cs
- DbModificationClause.cs
- SerialErrors.cs
- DomNameTable.cs
- AppliedDeviceFiltersEditor.cs
- FormatException.cs
- ServiceProviders.cs
- TextSelectionHighlightLayer.cs
- HtmlInputReset.cs
- IncrementalHitTester.cs
- SqlProviderManifest.cs
- ImageButton.cs
- FileUtil.cs
- ToolStripButton.cs
- GridItemCollection.cs
- ListViewPagedDataSource.cs
- CultureData.cs
- XmlSchemaGroup.cs
- FontUnitConverter.cs
- ISFClipboardData.cs
- XPathNavigator.cs
- XPathAncestorIterator.cs
- SemanticTag.cs
- DataGridTableCollection.cs
- HtmlValidationSummaryAdapter.cs
- BitmapEffectState.cs
- TransformConverter.cs
- SurrogateSelector.cs
- SweepDirectionValidation.cs
- PropertyInformationCollection.cs
- BuildProvidersCompiler.cs
- DefaultTraceListener.cs
- CodeTypeDelegate.cs
- Pointer.cs
- RewritingPass.cs
- ListBox.cs
- FunctionParameter.cs
- LookupBindingPropertiesAttribute.cs
- ModuleBuilderData.cs
- ObjectDataSourceEventArgs.cs
- IDataContractSurrogate.cs
- ClientScriptManager.cs
- FixedPageStructure.cs
- OdbcTransaction.cs
- ActiveDocumentEvent.cs
- CharConverter.cs
- DirtyTextRange.cs
- NativeMethods.cs
- SystemIPInterfaceStatistics.cs
- PnrpPeerResolverBindingElement.cs
- TextInfo.cs
- Int32.cs
- TraceListener.cs
- XMLSchema.cs
- DesignerSerializerAttribute.cs
- SiteMapPath.cs
- CreateRefExpr.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XmlCustomFormatter.cs
- WindowsProgressbar.cs
- TableItemPattern.cs
- WinInetCache.cs
- IntSecurity.cs
- SafeNativeMethods.cs
- SeekableMessageNavigator.cs
- ComponentResourceManager.cs