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
- ProcessManager.cs
- CustomSignedXml.cs
- Socket.cs
- ColorBlend.cs
- DurationConverter.cs
- TableLayoutPanelCellPosition.cs
- SetterBaseCollection.cs
- SoapSchemaExporter.cs
- PipelineModuleStepContainer.cs
- TypedTableBaseExtensions.cs
- EndpointConfigContainer.cs
- StoreAnnotationsMap.cs
- CapabilitiesSection.cs
- StateMachineSubscriptionManager.cs
- SQLInt32Storage.cs
- DropSource.cs
- ToolStripGrip.cs
- Triplet.cs
- ProcessProtocolHandler.cs
- bidPrivateBase.cs
- DataControlField.cs
- FontWeight.cs
- CaseInsensitiveHashCodeProvider.cs
- PriorityChain.cs
- PointAnimationClockResource.cs
- WebBrowser.cs
- FlowDocumentView.cs
- XmlConvert.cs
- CompilationUnit.cs
- ObjectItemCollection.cs
- ExceptionUtil.cs
- OptionalMessageQuery.cs
- MessageAction.cs
- WindowsEditBox.cs
- QilTypeChecker.cs
- WebCategoryAttribute.cs
- ResourceAssociationSet.cs
- Registry.cs
- ListBindingConverter.cs
- ConnectionInterfaceCollection.cs
- SerialStream.cs
- LassoSelectionBehavior.cs
- SafeUserTokenHandle.cs
- XhtmlBasicPageAdapter.cs
- Panel.cs
- DataExpression.cs
- SafeNativeMethods.cs
- DropDownList.cs
- TextClipboardData.cs
- TypeBuilderInstantiation.cs
- DispatcherExceptionEventArgs.cs
- IntellisenseTextBox.cs
- GridViewPageEventArgs.cs
- CustomErrorsSectionWrapper.cs
- XmlDataSourceView.cs
- DependencyPropertyHelper.cs
- DBPropSet.cs
- SqlDataReader.cs
- SerialReceived.cs
- XamlToRtfParser.cs
- SqlDataSourceTableQuery.cs
- SettingsBindableAttribute.cs
- HttpApplicationFactory.cs
- OracleFactory.cs
- ExceptionUtility.cs
- StreamSecurityUpgradeInitiator.cs
- TemplateContent.cs
- HtmlTable.cs
- ResourceReferenceKeyNotFoundException.cs
- ObjectStateFormatter.cs
- FacetChecker.cs
- NativeMethods.cs
- StreamInfo.cs
- ValueType.cs
- _DynamicWinsockMethods.cs
- ButtonChrome.cs
- HandlerFactoryCache.cs
- Set.cs
- XmlDataSourceView.cs
- EncoderBestFitFallback.cs
- InvalidCastException.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- RequestCachePolicy.cs
- WmlTextViewAdapter.cs
- HandlerFactoryWrapper.cs
- SqlCacheDependency.cs
- SocketException.cs
- FamilyCollection.cs
- InfoCardCryptoHelper.cs
- PackageFilter.cs
- SortedList.cs
- UpdateCommand.cs
- AdPostCacheSubstitution.cs
- ActivityCodeDomSerializationManager.cs
- EventEntry.cs
- OrderedDictionary.cs
- TextUtf8RawTextWriter.cs
- SystemMulticastIPAddressInformation.cs
- TripleDES.cs
- LinkedResource.cs