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
- WindowsSlider.cs
- RepeatBehaviorConverter.cs
- HMAC.cs
- EmissiveMaterial.cs
- FixedSOMSemanticBox.cs
- HwndSourceKeyboardInputSite.cs
- TableLayoutSettingsTypeConverter.cs
- BuildTopDownAttribute.cs
- WebPartChrome.cs
- XmlElementAttribute.cs
- SectionUpdates.cs
- VisualTreeUtils.cs
- InstanceDataCollection.cs
- TextUtf8RawTextWriter.cs
- VerificationAttribute.cs
- XmlValidatingReader.cs
- DateTimePicker.cs
- TimelineGroup.cs
- ManagedIStream.cs
- TypeNameConverter.cs
- FormsAuthentication.cs
- CallbackBehaviorAttribute.cs
- ProgressBar.cs
- EraserBehavior.cs
- FileLevelControlBuilderAttribute.cs
- HttpHeaderCollection.cs
- ErrorRuntimeConfig.cs
- ListViewContainer.cs
- EntityDataSourceEntitySetNameItem.cs
- TreeSet.cs
- BuildProvider.cs
- BoundColumn.cs
- Parameter.cs
- WeakReferenceEnumerator.cs
- PageParserFilter.cs
- SQLChars.cs
- TraceContextRecord.cs
- DispatcherSynchronizationContext.cs
- ReflectionPermission.cs
- CallSiteHelpers.cs
- FrameworkRichTextComposition.cs
- DbMetaDataCollectionNames.cs
- ScrollChangedEventArgs.cs
- DependencyPropertyAttribute.cs
- MultiTargetingUtil.cs
- PhonemeConverter.cs
- Paragraph.cs
- MessageContractAttribute.cs
- ToolboxComponentsCreatedEventArgs.cs
- Annotation.cs
- HttpListenerContext.cs
- ProxyElement.cs
- TitleStyle.cs
- DBProviderConfigurationHandler.cs
- XMLSyntaxException.cs
- ProgressBar.cs
- IItemContainerGenerator.cs
- OptimalBreakSession.cs
- WebBrowser.cs
- storepermissionattribute.cs
- MediaElementAutomationPeer.cs
- SolidColorBrush.cs
- DesignBindingConverter.cs
- DBDataPermission.cs
- InterleavedZipPartStream.cs
- FormsAuthenticationModule.cs
- DataGridLength.cs
- TableSectionStyle.cs
- TextOnlyOutput.cs
- HMACSHA256.cs
- Context.cs
- ControlLocalizer.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- _ListenerResponseStream.cs
- AffineTransform3D.cs
- TagPrefixAttribute.cs
- SingleResultAttribute.cs
- SqlNamer.cs
- WizardSideBarListControlItemEventArgs.cs
- CssClassPropertyAttribute.cs
- XslNumber.cs
- OracleRowUpdatedEventArgs.cs
- LookupBindingPropertiesAttribute.cs
- VariableAction.cs
- DetailsViewActionList.cs
- Thread.cs
- NavigationProgressEventArgs.cs
- Container.cs
- GatewayDefinition.cs
- OutputScopeManager.cs
- Connector.xaml.cs
- SpeechRecognitionEngine.cs
- BinHexEncoder.cs
- DataFormat.cs
- WebResourceAttribute.cs
- SslStreamSecurityBindingElement.cs
- SortFieldComparer.cs
- WmlSelectionListAdapter.cs
- SafeFileMapViewHandle.cs
- DBPropSet.cs