Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ExpressionVisitorHelpers.cs / 1305376 / 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 ReadOnlyCollectionToReadOnlyCollection (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 ReadOnlyCollectionToReadOnlyCollection (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
- HtmlSelect.cs
- ShaderEffect.cs
- TypeSystem.cs
- AddressingProperty.cs
- NTAccount.cs
- XmlElementAttributes.cs
- UpdateTracker.cs
- columnmapkeybuilder.cs
- KeyValueConfigurationElement.cs
- EventListenerClientSide.cs
- SafeViewOfFileHandle.cs
- ProviderIncompatibleException.cs
- IgnoreFileBuildProvider.cs
- TextServicesManager.cs
- SQLChars.cs
- Compensate.cs
- OutputCacheSettings.cs
- DataException.cs
- FilterEventArgs.cs
- SelectionBorderGlyph.cs
- PrintPageEvent.cs
- DoubleAnimationUsingPath.cs
- EnumMember.cs
- DataColumnMappingCollection.cs
- ClientBuildManager.cs
- WpfXamlLoader.cs
- UniformGrid.cs
- DesignerActionHeaderItem.cs
- Mouse.cs
- ProfileSection.cs
- ImageKeyConverter.cs
- SplashScreen.cs
- ZoomPercentageConverter.cs
- Symbol.cs
- SchemaType.cs
- TextElementAutomationPeer.cs
- EdmItemCollection.cs
- UnsafeNativeMethods.cs
- TdsParserSessionPool.cs
- CurrencyWrapper.cs
- HtmlToClrEventProxy.cs
- UpdateProgress.cs
- GeneralTransform.cs
- DataBinder.cs
- VisualStyleRenderer.cs
- ScrollData.cs
- PenLineJoinValidation.cs
- RegisteredExpandoAttribute.cs
- MemberHolder.cs
- UInt16Storage.cs
- OdbcConnectionString.cs
- Trace.cs
- ParamArrayAttribute.cs
- HttpCachePolicyBase.cs
- RuntimeIdentifierPropertyAttribute.cs
- MediaSystem.cs
- MsmqIntegrationSecurity.cs
- ImageSourceConverter.cs
- Type.cs
- IsolatedStoragePermission.cs
- SetIterators.cs
- Dynamic.cs
- Pool.cs
- CacheHelper.cs
- SizeConverter.cs
- CreatingCookieEventArgs.cs
- ByteAnimationBase.cs
- LayoutInformation.cs
- IPAddressCollection.cs
- TextEditorThreadLocalStore.cs
- TransportContext.cs
- TypeResolvingOptions.cs
- DrawingAttributesDefaultValueFactory.cs
- NodeCounter.cs
- IApplicationTrustManager.cs
- TableCell.cs
- SiteMapDataSource.cs
- QuadraticBezierSegment.cs
- DataGridColumn.cs
- AdRotatorDesigner.cs
- ChangeConflicts.cs
- ActivitiesCollection.cs
- DiscoveryClientDuplexChannel.cs
- EdmType.cs
- Crypto.cs
- CqlLexerHelpers.cs
- XhtmlBasicValidatorAdapter.cs
- MarkupExtensionSerializer.cs
- ProfileModule.cs
- CodeAssignStatement.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- BulletedList.cs
- ThreadExceptionDialog.cs
- SafeViewOfFileHandle.cs
- CollectionEditorDialog.cs
- CodeConditionStatement.cs
- XmlFormatExtensionPointAttribute.cs
- SchemaNames.cs
- WindowsUpDown.cs
- TabPanel.cs