Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- RuntimeHandles.cs
- LoginUtil.cs
- NativeMethods.cs
- HtmlInputControl.cs
- CodeArrayIndexerExpression.cs
- SamlAuthorityBinding.cs
- ProtectedProviderSettings.cs
- Perspective.cs
- SequenceQuery.cs
- Quaternion.cs
- ExtendedProperty.cs
- SystemColors.cs
- Int32Rect.cs
- DataRelationCollection.cs
- RewritingPass.cs
- IdleTimeoutMonitor.cs
- ColumnTypeConverter.cs
- InstanceDataCollection.cs
- DbConvert.cs
- IdentityManager.cs
- PeerNameRecordCollection.cs
- FormsAuthentication.cs
- _AcceptOverlappedAsyncResult.cs
- VirtualPath.cs
- TablePattern.cs
- NativeMethods.cs
- ConstantCheck.cs
- String.cs
- OracleCommandBuilder.cs
- RectangleHotSpot.cs
- SystemDiagnosticsSection.cs
- FileUtil.cs
- CompilerWrapper.cs
- SystemWebCachingSectionGroup.cs
- TextRangeAdaptor.cs
- Line.cs
- _CacheStreams.cs
- DebugTraceHelper.cs
- DNS.cs
- MaterializeFromAtom.cs
- TypeUsageBuilder.cs
- WindowsIPAddress.cs
- IDispatchConstantAttribute.cs
- CheckBox.cs
- TransportChannelFactory.cs
- EdmProperty.cs
- Mutex.cs
- SamlSecurityTokenAuthenticator.cs
- OperatorExpressions.cs
- IDQuery.cs
- XslAst.cs
- SecondaryViewProvider.cs
- XmlWriter.cs
- CqlLexerHelpers.cs
- DataGridViewComponentPropertyGridSite.cs
- CodeTypeDeclaration.cs
- MachineSettingsSection.cs
- SqlParameter.cs
- PixelFormatConverter.cs
- DataGridCell.cs
- DnsPermission.cs
- ZoneIdentityPermission.cs
- ObjectHelper.cs
- AdRotator.cs
- _RequestCacheProtocol.cs
- Brushes.cs
- TwoPhaseCommit.cs
- MetadataPropertyCollection.cs
- OracleConnectionString.cs
- AppDomainInfo.cs
- CheckedListBox.cs
- ConnectionManager.cs
- Table.cs
- SamlAssertion.cs
- CommunicationObject.cs
- DbDataAdapter.cs
- _HeaderInfo.cs
- Stroke.cs
- OutKeywords.cs
- ConfigurationSchemaErrors.cs
- Int32Converter.cs
- ReadOnlyKeyedCollection.cs
- XmlSchemaParticle.cs
- XmlTextReaderImplHelpers.cs
- WeakRefEnumerator.cs
- SettingsContext.cs
- DocumentPaginator.cs
- _AutoWebProxyScriptEngine.cs
- SQLChars.cs
- SettingsAttributeDictionary.cs
- PriorityRange.cs
- MessageHeaderInfoTraceRecord.cs
- CompositeCollection.cs
- TraceRecord.cs
- UseAttributeSetsAction.cs
- RootProfilePropertySettingsCollection.cs
- WorkflowPageSetupDialog.cs
- StringUtil.cs
- DrawingContextWalker.cs
- CodeDirectiveCollection.cs