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
- WebScriptClientGenerator.cs
- ItemCollection.cs
- CalendarDesigner.cs
- RecognitionEventArgs.cs
- CopyNodeSetAction.cs
- PathStreamGeometryContext.cs
- DownloadProgressEventArgs.cs
- WindowsGrip.cs
- OpCopier.cs
- SqlUDTStorage.cs
- XhtmlBasicPageAdapter.cs
- __FastResourceComparer.cs
- FrameworkElementFactoryMarkupObject.cs
- TransportContext.cs
- FormsAuthenticationCredentials.cs
- SqlClientMetaDataCollectionNames.cs
- SchemaElementLookUpTable.cs
- EdmType.cs
- CollectionBase.cs
- BulletDecorator.cs
- WebPartDescriptionCollection.cs
- CursorConverter.cs
- DynamicRendererThreadManager.cs
- XPathMultyIterator.cs
- ServiceContractGenerationContext.cs
- TextTrailingWordEllipsis.cs
- OperationCanceledException.cs
- ipaddressinformationcollection.cs
- CompositeDataBoundControl.cs
- RemotingAttributes.cs
- FontSource.cs
- SelectionProcessor.cs
- DataService.cs
- TemplateApplicationHelper.cs
- ObjectAnimationUsingKeyFrames.cs
- ElapsedEventArgs.cs
- DebuggerAttributes.cs
- AssociationSet.cs
- SignatureConfirmationElement.cs
- D3DImage.cs
- SymmetricAlgorithm.cs
- EventBuilder.cs
- QilInvokeEarlyBound.cs
- ChangeBlockUndoRecord.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- DetailsViewModeEventArgs.cs
- DBSchemaRow.cs
- ArglessEventHandlerProxy.cs
- ExpressionBuilder.cs
- XdrBuilder.cs
- AuthenticationModuleElementCollection.cs
- IdentityModelStringsVersion1.cs
- DataSourceControl.cs
- GroupJoinQueryOperator.cs
- TimeoutConverter.cs
- DataTableMappingCollection.cs
- InstanceLockQueryResult.cs
- ContainerUIElement3D.cs
- DescendantQuery.cs
- XmlWriterSettings.cs
- DbParameterHelper.cs
- EventLogPermissionEntry.cs
- PersonalizableTypeEntry.cs
- RijndaelManaged.cs
- ExpressionBuilder.cs
- TextRangeSerialization.cs
- WbmpConverter.cs
- ScopelessEnumAttribute.cs
- SQLCharsStorage.cs
- CodeMethodInvokeExpression.cs
- TransactionValidationBehavior.cs
- WebPartTracker.cs
- SudsParser.cs
- FileUtil.cs
- LiteralControl.cs
- SByte.cs
- ScrollItemPatternIdentifiers.cs
- ViewPort3D.cs
- ListViewItemEventArgs.cs
- LineMetrics.cs
- Trace.cs
- ValidationManager.cs
- GlobalEventManager.cs
- InitialServerConnectionReader.cs
- EdmToObjectNamespaceMap.cs
- followingquery.cs
- ObjectItemCachedAssemblyLoader.cs
- DataContractSerializerOperationGenerator.cs
- ResourceDictionaryCollection.cs
- KeyEvent.cs
- BinaryWriter.cs
- CngKey.cs
- InternalMappingException.cs
- TableItemProviderWrapper.cs
- externdll.cs
- columnmapfactory.cs
- ProtocolsConfigurationHandler.cs
- OutputCacheModule.cs
- BrowserDefinitionCollection.cs
- EndPoint.cs