Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- OleDbMetaDataFactory.cs
- AutomationPropertyInfo.cs
- IPipelineRuntime.cs
- XPathMessageFilterElementComparer.cs
- EntitySetRetriever.cs
- ExpressionBuilderContext.cs
- MergeFailedEvent.cs
- OdbcConnectionOpen.cs
- ConfigXmlCDataSection.cs
- IdentitySection.cs
- ToolStripLocationCancelEventArgs.cs
- TrackingMemoryStream.cs
- Adorner.cs
- DelegatedStream.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- _NtlmClient.cs
- WindowsToolbarItemAsMenuItem.cs
- _AutoWebProxyScriptWrapper.cs
- MapPathBasedVirtualPathProvider.cs
- Point3DConverter.cs
- WebBrowserContainer.cs
- XmlDictionaryReaderQuotasElement.cs
- StreamReader.cs
- XPathNodeInfoAtom.cs
- SafeSecurityHandles.cs
- LineSegment.cs
- RangeValuePatternIdentifiers.cs
- AnnotationService.cs
- CheckBoxList.cs
- TrackingProfileManager.cs
- DiscoveryReference.cs
- PeerCollaborationPermission.cs
- StrokeNodeEnumerator.cs
- ToolboxControl.cs
- DropShadowBitmapEffect.cs
- Version.cs
- PropertyValueUIItem.cs
- RadioButtonPopupAdapter.cs
- HtmlTableCellCollection.cs
- DataBoundControlAdapter.cs
- DataGridViewComboBoxEditingControl.cs
- WindowsStatusBar.cs
- EnglishPluralizationService.cs
- AssemblyNameProxy.cs
- CachedPathData.cs
- ArithmeticException.cs
- SecurityTokenRequirement.cs
- dataprotectionpermissionattribute.cs
- XmlQueryCardinality.cs
- log.cs
- ImageBrush.cs
- WebBrowserUriTypeConverter.cs
- CompensatableTransactionScopeActivity.cs
- WithParamAction.cs
- CurrentTimeZone.cs
- ContextMarshalException.cs
- WebControlsSection.cs
- indexingfiltermarshaler.cs
- Keyboard.cs
- QueryStringParameter.cs
- EqualityComparer.cs
- PhysicalAddress.cs
- BitSet.cs
- StorageMappingItemCollection.cs
- LoginCancelEventArgs.cs
- RoutedEvent.cs
- GridViewUpdateEventArgs.cs
- ExpandedWrapper.cs
- QilIterator.cs
- TextTrailingWordEllipsis.cs
- InfocardInteractiveChannelInitializer.cs
- XPathScanner.cs
- XmlSchemaIdentityConstraint.cs
- BrowserCapabilitiesCodeGenerator.cs
- ItemList.cs
- DbConnectionHelper.cs
- EtwTrace.cs
- PkcsUtils.cs
- CompoundFileStorageReference.cs
- GenericParameterDataContract.cs
- EmbossBitmapEffect.cs
- ScrollChrome.cs
- ListBindableAttribute.cs
- Config.cs
- DataFormats.cs
- DataConnectionHelper.cs
- ThrowHelper.cs
- FlowDocumentFormatter.cs
- ResourceAssociationSetEnd.cs
- PropertyIDSet.cs
- DataSourceUtil.cs
- InheritedPropertyChangedEventArgs.cs
- FileUtil.cs
- LocalValueEnumerator.cs
- CriticalHandle.cs
- ActivityScheduledQuery.cs
- ProtocolsConfiguration.cs
- AssertSection.cs
- HtmlHead.cs
- Attributes.cs