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
- LoginNameDesigner.cs
- XmlResolver.cs
- TextTreeUndo.cs
- SystemFonts.cs
- VirtualPathProvider.cs
- SafeCloseHandleCritical.cs
- ForeignKeyConstraint.cs
- LayoutSettings.cs
- SystemResourceHost.cs
- DateTimeUtil.cs
- UniqueEventHelper.cs
- ScriptComponentDescriptor.cs
- SqlConnectionStringBuilder.cs
- EqualityComparer.cs
- CompositeDuplexBindingElement.cs
- DataControlFieldCell.cs
- Highlights.cs
- ServerProtocol.cs
- Internal.cs
- FormClosedEvent.cs
- ClientScriptItemCollection.cs
- PersianCalendar.cs
- CustomTypeDescriptor.cs
- MailSettingsSection.cs
- FrameworkElementAutomationPeer.cs
- TriggerActionCollection.cs
- PageClientProxyGenerator.cs
- ObjectMemberMapping.cs
- _AuthenticationState.cs
- DataList.cs
- PolyBezierSegmentFigureLogic.cs
- CodeStatement.cs
- ToolStripLabel.cs
- StorageAssociationSetMapping.cs
- TextTrailingCharacterEllipsis.cs
- Activity.cs
- XmlDataSourceNodeDescriptor.cs
- DispatcherHooks.cs
- SchemaEntity.cs
- TextTrailingWordEllipsis.cs
- KeyTimeConverter.cs
- _AutoWebProxyScriptHelper.cs
- FileChangesMonitor.cs
- GACIdentityPermission.cs
- ListViewSortEventArgs.cs
- UserInitiatedNavigationPermission.cs
- SaveWorkflowAsyncResult.cs
- CurrentChangingEventManager.cs
- LocalizationCodeDomSerializer.cs
- MSAAEventDispatcher.cs
- CryptographicAttribute.cs
- InternalControlCollection.cs
- RequiredFieldValidator.cs
- Int32Converter.cs
- Page.cs
- XmlRawWriter.cs
- TagPrefixCollection.cs
- StringAnimationUsingKeyFrames.cs
- MetadataItemSerializer.cs
- LeafCellTreeNode.cs
- DataTableNewRowEvent.cs
- EmptyStringExpandableObjectConverter.cs
- Stroke.cs
- ExternalCalls.cs
- SimpleType.cs
- SqlConnectionString.cs
- TraceData.cs
- ParameterExpression.cs
- compensatingcollection.cs
- adornercollection.cs
- AttachedAnnotationChangedEventArgs.cs
- HTMLTextWriter.cs
- VSWCFServiceContractGenerator.cs
- mongolianshape.cs
- SqlMetaData.cs
- EmbeddedMailObjectsCollection.cs
- StringFunctions.cs
- HealthMonitoringSectionHelper.cs
- WindowsUpDown.cs
- CommandValueSerializer.cs
- SystemWebCachingSectionGroup.cs
- SoapExtension.cs
- NativeMethods.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ThemeConfigurationDialog.cs
- RootNamespaceAttribute.cs
- Itemizer.cs
- XPathMessageContext.cs
- SequenceRangeCollection.cs
- InternalMappingException.cs
- DocumentAutomationPeer.cs
- Splitter.cs
- EntityDataSourceContainerNameItem.cs
- DispatcherHookEventArgs.cs
- HostingEnvironmentSection.cs
- EventLogQuery.cs
- OrderedDictionary.cs
- XmlILAnnotation.cs
- ResourceDictionary.cs
- XmlWriter.cs