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
- Membership.cs
- WebPartTransformerAttribute.cs
- ResourcePool.cs
- PackWebResponse.cs
- HtmlInputButton.cs
- StringFreezingAttribute.cs
- WebBrowsableAttribute.cs
- EntityContainerRelationshipSetEnd.cs
- VirtualPathProvider.cs
- BuildResultCache.cs
- CapabilitiesSection.cs
- PositiveTimeSpanValidatorAttribute.cs
- LongSumAggregationOperator.cs
- ConfigurationSettings.cs
- TypeContext.cs
- BridgeDataRecord.cs
- ZoneButton.cs
- FrameworkName.cs
- MaterializeFromAtom.cs
- StorageMappingFragment.cs
- SqlDependencyUtils.cs
- TextTreeTextNode.cs
- PrinterResolution.cs
- BaseParser.cs
- GlyphCache.cs
- PageCache.cs
- QilFactory.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- WindowsListViewItem.cs
- ErrorRuntimeConfig.cs
- ExpressionEditor.cs
- ApplicationId.cs
- SudsCommon.cs
- XmlSchemaDatatype.cs
- XPathScanner.cs
- ThrowHelper.cs
- PageAsyncTaskManager.cs
- QuaternionKeyFrameCollection.cs
- TreeViewHitTestInfo.cs
- XmlConverter.cs
- RtType.cs
- XmlSchemaCompilationSettings.cs
- SystemColorTracker.cs
- CharKeyFrameCollection.cs
- ComponentEvent.cs
- RIPEMD160.cs
- _AutoWebProxyScriptWrapper.cs
- EntityCollection.cs
- ConsoleKeyInfo.cs
- XComponentModel.cs
- RegexMatch.cs
- BaseValidator.cs
- AccessViolationException.cs
- FontStretchConverter.cs
- TagMapCollection.cs
- HtmlTitle.cs
- SqlSupersetValidator.cs
- DeferredElementTreeState.cs
- WorkflowMarkupSerializationProvider.cs
- RouteData.cs
- GenericUriParser.cs
- ElementNotEnabledException.cs
- CodeObjectCreateExpression.cs
- CryptoHelper.cs
- WaitHandle.cs
- WindowsScrollBarBits.cs
- XmlMtomWriter.cs
- Stack.cs
- PointValueSerializer.cs
- ConfigurationStrings.cs
- ResourceAttributes.cs
- CommandManager.cs
- PageOutputColor.cs
- Literal.cs
- MenuItemStyle.cs
- LowerCaseStringConverter.cs
- XmlSchemaElement.cs
- ItemContainerProviderWrapper.cs
- WebControlAdapter.cs
- SpeechAudioFormatInfo.cs
- SemanticBasicElement.cs
- PhysicalFontFamily.cs
- WindowInteropHelper.cs
- PropertyMap.cs
- IgnoreDeviceFilterElementCollection.cs
- xmlfixedPageInfo.cs
- TemplateParser.cs
- Positioning.cs
- CompositeTypefaceMetrics.cs
- SSmlParser.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- BamlLocalizableResourceKey.cs
- TraceRecord.cs
- MouseButtonEventArgs.cs
- ConnectionManagementElement.cs
- ConfigurationManagerHelper.cs
- ListBoxItemAutomationPeer.cs
- CombinedTcpChannel.cs
- DataSetViewSchema.cs
- SqlTriggerContext.cs