Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ToolStripScrollButton.cs
- SqlIdentifier.cs
- IconBitmapDecoder.cs
- DataServiceContext.cs
- ConfigurationErrorsException.cs
- ChildDocumentBlock.cs
- UniqueConstraint.cs
- WebPartEditVerb.cs
- ExpressionList.cs
- Calendar.cs
- XhtmlBasicCommandAdapter.cs
- HitTestResult.cs
- RegionData.cs
- BoundField.cs
- SmiEventStream.cs
- Select.cs
- InkCanvasInnerCanvas.cs
- ADConnectionHelper.cs
- AssertHelper.cs
- MetadataResolver.cs
- WebConfigurationFileMap.cs
- TargetConverter.cs
- TaskExceptionHolder.cs
- SettingsPropertyNotFoundException.cs
- ResourceAssociationSetEnd.cs
- ExpressionEditorSheet.cs
- _SSPIWrapper.cs
- OletxTransactionManager.cs
- OutOfProcStateClientManager.cs
- SchemaMerger.cs
- EditBehavior.cs
- PrintControllerWithStatusDialog.cs
- CodeVariableDeclarationStatement.cs
- DataGridTextBox.cs
- EntityDataSourceColumn.cs
- ThreadAbortException.cs
- ErrorWrapper.cs
- TimelineClockCollection.cs
- TextBox.cs
- HMAC.cs
- SafeLibraryHandle.cs
- PackageRelationshipCollection.cs
- RadioButton.cs
- PrivilegeNotHeldException.cs
- InkSerializer.cs
- CreateUserErrorEventArgs.cs
- WebPartExportVerb.cs
- StylusEditingBehavior.cs
- XmlSchemaSimpleTypeUnion.cs
- SoapBinding.cs
- NavigationEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- TableLayoutPanel.cs
- odbcmetadatacollectionnames.cs
- DiagnosticTraceSchemas.cs
- ClearTypeHintValidation.cs
- DesignerTransaction.cs
- StringArrayEditor.cs
- ToolStripItemCollection.cs
- KeyboardDevice.cs
- DBCSCodePageEncoding.cs
- GifBitmapEncoder.cs
- LogRecordSequence.cs
- SpeechDetectedEventArgs.cs
- ToolStripItemRenderEventArgs.cs
- VersionedStream.cs
- SqlReorderer.cs
- CommandDevice.cs
- DrawingState.cs
- ToolZone.cs
- PageThemeBuildProvider.cs
- GridViewColumnHeaderAutomationPeer.cs
- DataProtection.cs
- OpenTypeCommon.cs
- AmbientValueAttribute.cs
- ActiveXSite.cs
- SafeThreadHandle.cs
- ImageIndexConverter.cs
- FreezableCollection.cs
- MatrixCamera.cs
- NonParentingControl.cs
- TopClause.cs
- InputMethod.cs
- WebPartTracker.cs
- SystemGatewayIPAddressInformation.cs
- TrustDriver.cs
- StackBuilderSink.cs
- BuildProviderCollection.cs
- FileInfo.cs
- DrawListViewColumnHeaderEventArgs.cs
- ViewBase.cs
- ManifestBasedResourceGroveler.cs
- AudioLevelUpdatedEventArgs.cs
- DisposableCollectionWrapper.cs
- CommandTreeTypeHelper.cs
- SQLSingleStorage.cs
- MimeTypeAttribute.cs
- DrawingGroup.cs
- shaperfactoryquerycachekey.cs
- ChildDocumentBlock.cs