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 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
- DateTimeFormatInfo.cs
- PieceDirectory.cs
- EditBehavior.cs
- WindowsScrollBar.cs
- TextTreeTextNode.cs
- _SingleItemRequestCache.cs
- FontDialog.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- KeySpline.cs
- XPathCompileException.cs
- DataViewSetting.cs
- DefaultPrintController.cs
- RecipientInfo.cs
- HostedHttpContext.cs
- DockingAttribute.cs
- HttpHandler.cs
- ImageCodecInfoPrivate.cs
- AddingNewEventArgs.cs
- DataBoundControlAdapter.cs
- ZipQueryOperator.cs
- Attributes.cs
- figurelengthconverter.cs
- ProvideValueServiceProvider.cs
- StorageEndPropertyMapping.cs
- FreezableCollection.cs
- DataServiceRequestOfT.cs
- CompilerWrapper.cs
- nulltextnavigator.cs
- SQLStringStorage.cs
- FontEmbeddingManager.cs
- XhtmlBasicCommandAdapter.cs
- TextFormatter.cs
- StateMachineSubscription.cs
- SiteMapSection.cs
- LinearGradientBrush.cs
- Overlapped.cs
- WebServiceTypeData.cs
- DCSafeHandle.cs
- XpsFilter.cs
- SecurityProtocolCorrelationState.cs
- LongCountAggregationOperator.cs
- ObjectDataSourceEventArgs.cs
- SmtpAuthenticationManager.cs
- CustomErrorsSection.cs
- CodeDesigner.cs
- CoTaskMemHandle.cs
- StretchValidation.cs
- LinearGradientBrush.cs
- EntityDataSourceQueryBuilder.cs
- LayoutEngine.cs
- SlipBehavior.cs
- Visual3D.cs
- NetSectionGroup.cs
- FrameworkContentElement.cs
- DataContractSerializerSection.cs
- SqlMetaData.cs
- DocumentViewerConstants.cs
- XmlSecureResolver.cs
- PropertyMap.cs
- Int32Converter.cs
- DataGridViewCellConverter.cs
- ObjectResult.cs
- Documentation.cs
- TransformerConfigurationWizardBase.cs
- CryptoConfig.cs
- GeometryCollection.cs
- Errors.cs
- EventProviderTraceListener.cs
- FactoryMaker.cs
- SecurityKeyEntropyMode.cs
- PeerApplicationLaunchInfo.cs
- TimeSpan.cs
- ConnectionManagementSection.cs
- KeysConverter.cs
- SystemInfo.cs
- XmlSchemaAttributeGroupRef.cs
- StackBuilderSink.cs
- ObjectParameter.cs
- OneToOneMappingSerializer.cs
- HexParser.cs
- Point3DKeyFrameCollection.cs
- TcpClientChannel.cs
- StringStorage.cs
- HttpCachePolicyElement.cs
- SafeFileHandle.cs
- DesignerCommandAdapter.cs
- IgnoreSectionHandler.cs
- WithParamAction.cs
- ApplicationTrust.cs
- UnsafeNativeMethods.cs
- MappingException.cs
- ClusterRegistryConfigurationProvider.cs
- WorkItem.cs
- LineGeometry.cs
- IndependentAnimationStorage.cs
- securitycriticaldataformultiplegetandset.cs
- LockRecursionException.cs
- TypeBuilder.cs
- PKCS1MaskGenerationMethod.cs
- TableSectionStyle.cs