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
- BaseResourcesBuildProvider.cs
- TranslateTransform.cs
- FormsAuthenticationConfiguration.cs
- HttpListenerPrefixCollection.cs
- SoapElementAttribute.cs
- TraceContext.cs
- HtmlTernaryTree.cs
- XmlSchemaSimpleTypeUnion.cs
- ImplicitInputBrush.cs
- SystemFonts.cs
- TemplateManager.cs
- XmlEventCache.cs
- LockedBorderGlyph.cs
- CommandCollectionEditor.cs
- DependencyPropertyDescriptor.cs
- NavigationHelper.cs
- OleDbConnectionInternal.cs
- processwaithandle.cs
- SecurityTokenSpecification.cs
- SignedPkcs7.cs
- OdbcConnectionStringbuilder.cs
- DataRelationPropertyDescriptor.cs
- SecurityRuntime.cs
- ElementNotEnabledException.cs
- ControlPaint.cs
- CompilerTypeWithParams.cs
- oledbmetadatacollectionnames.cs
- PreservationFileWriter.cs
- CmsUtils.cs
- DataView.cs
- NotifyIcon.cs
- HttpModuleActionCollection.cs
- InkCanvasFeedbackAdorner.cs
- FigureParaClient.cs
- DefaultHttpHandler.cs
- brushes.cs
- VScrollBar.cs
- RectConverter.cs
- StrongName.cs
- AspNetSynchronizationContext.cs
- CharEnumerator.cs
- Dynamic.cs
- XmlSchemaSubstitutionGroup.cs
- SmiEventSink_DeferedProcessing.cs
- Helper.cs
- NativeMethods.cs
- TreeViewImageIndexConverter.cs
- ToggleButton.cs
- SqlDataSourceView.cs
- SiteMapDataSource.cs
- AnimationClock.cs
- CallbackDebugElement.cs
- HGlobalSafeHandle.cs
- InputReport.cs
- InstanceDescriptor.cs
- Dictionary.cs
- PersistenceException.cs
- BindingMAnagerBase.cs
- WebZone.cs
- TextWriterTraceListener.cs
- BindingExpressionBase.cs
- ListViewUpdateEventArgs.cs
- Tuple.cs
- OdbcPermission.cs
- Mutex.cs
- HtmlTableCellCollection.cs
- datacache.cs
- RequiredFieldValidator.cs
- XmlToDatasetMap.cs
- Quaternion.cs
- EntitySetBase.cs
- RadioButton.cs
- ButtonPopupAdapter.cs
- SerializationTrace.cs
- RightsManagementPermission.cs
- Separator.cs
- XmlSchemaObjectTable.cs
- SafeRightsManagementEnvironmentHandle.cs
- CorrelationManager.cs
- DiagnosticStrings.cs
- ObjectQueryExecutionPlan.cs
- XhtmlBasicPageAdapter.cs
- ReferentialConstraintRoleElement.cs
- FixedBufferAttribute.cs
- Helper.cs
- MobileListItemCollection.cs
- QilSortKey.cs
- EntityDataSourceView.cs
- TemplateControlCodeDomTreeGenerator.cs
- WindowsGraphics.cs
- DiscoveryDocumentReference.cs
- DiscoveryClientDocuments.cs
- MetricEntry.cs
- ObjectHandle.cs
- ToolStripRenderEventArgs.cs
- MimeWriter.cs
- TreePrinter.cs
- HtmlMeta.cs
- DictionaryCustomTypeDescriptor.cs
- BackStopAuthenticationModule.cs