Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ExpressionVisitorHelpers.cs / 1305376 / 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
- AssemblySettingAttributes.cs
- WebPartVerbCollection.cs
- ConfigurationSectionGroupCollection.cs
- NameNode.cs
- VirtualizingStackPanel.cs
- filewebresponse.cs
- ClearTypeHintValidation.cs
- Rights.cs
- AppDomainCompilerProxy.cs
- ProviderConnectionPoint.cs
- ObjectIDGenerator.cs
- SingleStorage.cs
- DecoderReplacementFallback.cs
- DataGridViewCellStyleChangedEventArgs.cs
- MenuDesigner.cs
- TableFieldsEditor.cs
- NativeCompoundFileAPIs.cs
- _IPv6Address.cs
- BmpBitmapDecoder.cs
- IndexedGlyphRun.cs
- ObjectHandle.cs
- SolidBrush.cs
- ConfigurationSchemaErrors.cs
- GlobalDataBindingHandler.cs
- EntityProviderFactory.cs
- MaskedTextBox.cs
- HtmlInputText.cs
- IncomingWebRequestContext.cs
- NativeMethods.cs
- ListBase.cs
- RemotingAttributes.cs
- AppDomainAttributes.cs
- ChtmlTextBoxAdapter.cs
- FloaterParaClient.cs
- UrlAuthorizationModule.cs
- AuthenticationManager.cs
- SectionVisual.cs
- AndCondition.cs
- EncoderExceptionFallback.cs
- RuleSettings.cs
- QueryOutputWriter.cs
- HyperLink.cs
- pingexception.cs
- PeerNameRecord.cs
- MatrixValueSerializer.cs
- WebPartConnectionsEventArgs.cs
- NotSupportedException.cs
- IFlowDocumentViewer.cs
- TextWriterTraceListener.cs
- IriParsingElement.cs
- DeclaredTypeElement.cs
- IndexerNameAttribute.cs
- dbdatarecord.cs
- X509ChainPolicy.cs
- CodeObject.cs
- DataGridViewAdvancedBorderStyle.cs
- ListControlStringCollectionEditor.cs
- FamilyTypeface.cs
- ImpersonateTokenRef.cs
- X509ChainPolicy.cs
- MultipleViewPattern.cs
- LayoutTableCell.cs
- ServiceHostingEnvironment.cs
- DataSourceControl.cs
- CachedRequestParams.cs
- XmlSiteMapProvider.cs
- TextContainerHelper.cs
- LabelAutomationPeer.cs
- Soap.cs
- EditorZoneBase.cs
- SerializerWriterEventHandlers.cs
- XdrBuilder.cs
- LogicalTreeHelper.cs
- ExpressionUtilities.cs
- BooleanExpr.cs
- SoapTransportImporter.cs
- XhtmlBasicControlAdapter.cs
- SignatureToken.cs
- EntityDataSourceStatementEditorForm.cs
- _CookieModule.cs
- GenericArgumentsUpdater.cs
- Manipulation.cs
- UnsafeNativeMethods.cs
- JavaScriptSerializer.cs
- PropertyTabChangedEvent.cs
- SchemaManager.cs
- ContentElement.cs
- GeneratedContractType.cs
- NoResizeSelectionBorderGlyph.cs
- SqlConnectionStringBuilder.cs
- ActiveXSite.cs
- Pair.cs
- LOSFormatter.cs
- TreeNodeCollection.cs
- loginstatus.cs
- ValueQuery.cs
- LinkedResource.cs
- GridItemProviderWrapper.cs
- GlobalizationAssembly.cs
- Rectangle.cs