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
- XmlUTF8TextWriter.cs
- DecoderBestFitFallback.cs
- StringPropertyBuilder.cs
- PersonalizationProvider.cs
- ListViewDeletedEventArgs.cs
- Deserializer.cs
- XslTransform.cs
- EntityObject.cs
- BindingExpression.cs
- Decoder.cs
- XmlDeclaration.cs
- DataBoundControlHelper.cs
- namescope.cs
- xamlnodes.cs
- XmlElementElementCollection.cs
- JapaneseLunisolarCalendar.cs
- ReadOnlyTernaryTree.cs
- XmlNamedNodeMap.cs
- FormsAuthenticationEventArgs.cs
- StructuredTypeEmitter.cs
- XmlSchemaElement.cs
- SettingsSection.cs
- WebPartEditVerb.cs
- Cursor.cs
- SqlInternalConnectionSmi.cs
- StringArrayConverter.cs
- DataTableNewRowEvent.cs
- EnumMemberAttribute.cs
- ContractsBCL.cs
- WebMessageBodyStyleHelper.cs
- GlyphTypeface.cs
- TextServicesLoader.cs
- CompareInfo.cs
- XmlDeclaration.cs
- StylusCollection.cs
- PageBorderless.cs
- FlowDocumentPage.cs
- InheritanceContextHelper.cs
- PathGeometry.cs
- Schema.cs
- ImageCodecInfo.cs
- DependencyProperty.cs
- Group.cs
- EntityDataSourceWrapperCollection.cs
- PropertyRef.cs
- XXXInfos.cs
- CounterCreationData.cs
- SoapIgnoreAttribute.cs
- SafeRightsManagementQueryHandle.cs
- PrimaryKeyTypeConverter.cs
- EntityDataSourceDesigner.cs
- BindValidationContext.cs
- PathGeometry.cs
- DictionaryCustomTypeDescriptor.cs
- WeakReferenceList.cs
- DurationConverter.cs
- HtmlElementCollection.cs
- WebPartConnectionsEventArgs.cs
- ReadWriteSpinLock.cs
- LinqDataSourceValidationException.cs
- FixedSOMGroup.cs
- XmlKeywords.cs
- AppSettingsExpressionBuilder.cs
- uribuilder.cs
- FunctionImportMapping.cs
- MergablePropertyAttribute.cs
- OSFeature.cs
- BindingExpression.cs
- QuerySafeNavigator.cs
- MarkupCompilePass2.cs
- MarkupExtensionParser.cs
- IntranetCredentialPolicy.cs
- SmiTypedGetterSetter.cs
- XmlTextReader.cs
- AnnotationStore.cs
- LocatorManager.cs
- CodeTryCatchFinallyStatement.cs
- CodeFieldReferenceExpression.cs
- DataGridViewCellStyleChangedEventArgs.cs
- CrossAppDomainChannel.cs
- QueryStringParameter.cs
- AutomationPatternInfo.cs
- MetadataArtifactLoaderCompositeFile.cs
- OptimisticConcurrencyException.cs
- BroadcastEventHelper.cs
- DataReceivedEventArgs.cs
- CharEnumerator.cs
- objectquery_tresulttype.cs
- OneOfConst.cs
- QueryCacheKey.cs
- TextWriterTraceListener.cs
- webeventbuffer.cs
- ReadOnlyObservableCollection.cs
- PropertyPanel.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- MailWriter.cs
- MenuItem.cs
- ProxyHelper.cs
- GridSplitter.cs
- ApplicationSecurityManager.cs