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
- MachineKeySection.cs
- CollectionConverter.cs
- WebPartEditorCancelVerb.cs
- QilFunction.cs
- IdentityReference.cs
- WorkflowServiceBehavior.cs
- BinaryObjectWriter.cs
- InkPresenterAutomationPeer.cs
- HttpBindingExtension.cs
- WebConfigurationFileMap.cs
- ClientBuildManagerCallback.cs
- WinEventWrap.cs
- AutomationElementCollection.cs
- TailCallAnalyzer.cs
- TopClause.cs
- SpellerInterop.cs
- ShaperBuffers.cs
- EventMappingSettings.cs
- IdnMapping.cs
- VideoDrawing.cs
- ScrollEvent.cs
- NotImplementedException.cs
- WebBrowserNavigatingEventHandler.cs
- ByteAnimationUsingKeyFrames.cs
- QueryPageSettingsEventArgs.cs
- FreezableDefaultValueFactory.cs
- ToolStripButton.cs
- MediaContextNotificationWindow.cs
- TransformCryptoHandle.cs
- TableRow.cs
- CurrencyWrapper.cs
- SynchronousReceiveElement.cs
- VirtualizedItemProviderWrapper.cs
- DbMetaDataCollectionNames.cs
- RegisteredExpandoAttribute.cs
- Material.cs
- RunClient.cs
- HostingEnvironment.cs
- TypeInformation.cs
- RegexGroup.cs
- autovalidator.cs
- MTConfigUtil.cs
- VisualStyleRenderer.cs
- CryptoHelper.cs
- TimeSpanOrInfiniteValidator.cs
- RestHandlerFactory.cs
- AnnotationComponentChooser.cs
- ProxyWebPart.cs
- XPathAxisIterator.cs
- CngProvider.cs
- IisTraceListener.cs
- ButtonAutomationPeer.cs
- Win32SafeHandles.cs
- ObjectMemberMapping.cs
- AutoFocusStyle.xaml.cs
- DecoderReplacementFallback.cs
- OleDbMetaDataFactory.cs
- TagPrefixInfo.cs
- FakeModelItemImpl.cs
- TdsParameterSetter.cs
- EmptyEnumerator.cs
- LOSFormatter.cs
- AssemblyFilter.cs
- RuntimeIdentifierPropertyAttribute.cs
- OrderablePartitioner.cs
- filewebresponse.cs
- UnlockInstanceCommand.cs
- SatelliteContractVersionAttribute.cs
- HtmlInputRadioButton.cs
- DeferredSelectedIndexReference.cs
- CodeVariableDeclarationStatement.cs
- ScaleTransform3D.cs
- Hash.cs
- ProfileParameter.cs
- CollectionBase.cs
- XPathAncestorQuery.cs
- codemethodreferenceexpression.cs
- Timer.cs
- XmlSchemaAnnotated.cs
- InvalidDataException.cs
- GlyphInfoList.cs
- PageCodeDomTreeGenerator.cs
- EmptyCollection.cs
- VirtualPathProvider.cs
- ItemContainerProviderWrapper.cs
- ServerIdentity.cs
- RowsCopiedEventArgs.cs
- CodeTypeMemberCollection.cs
- TextEditorTyping.cs
- ISSmlParser.cs
- Point3DCollection.cs
- ItemList.cs
- ConfigXmlElement.cs
- ConstraintConverter.cs
- ExtendedProtectionPolicy.cs
- HistoryEventArgs.cs
- ScaleTransform3D.cs
- DateTimeConstantAttribute.cs
- UserControlCodeDomTreeGenerator.cs
- TcpSocketManager.cs