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
- ToolStripItemImageRenderEventArgs.cs
- GeometryValueSerializer.cs
- ListControlDataBindingHandler.cs
- DataSourceSelectArguments.cs
- HashHelper.cs
- MD5.cs
- sqlmetadatafactory.cs
- ProvidersHelper.cs
- ImagingCache.cs
- DataShape.cs
- WindowsUpDown.cs
- VersionedStream.cs
- Stylesheet.cs
- FormatException.cs
- Assembly.cs
- HoistedLocals.cs
- XmlSchemaObject.cs
- PtsContext.cs
- ControlBindingsCollection.cs
- FrameAutomationPeer.cs
- StringDictionaryWithComparer.cs
- DbMetaDataCollectionNames.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- NavigationHelper.cs
- StringDictionaryCodeDomSerializer.cs
- CoTaskMemHandle.cs
- OleDbPropertySetGuid.cs
- SoapReflectionImporter.cs
- WebServiceErrorEvent.cs
- CompiledQuery.cs
- LabelEditEvent.cs
- StorageSetMapping.cs
- CompositeActivityDesigner.cs
- UMPAttributes.cs
- SqlInfoMessageEvent.cs
- CodeGeneratorOptions.cs
- ImageAttributes.cs
- XmlnsCompatibleWithAttribute.cs
- TrustSection.cs
- ConfigurationProperty.cs
- WebMessageBodyStyleHelper.cs
- ContentType.cs
- ScrollChrome.cs
- ExtendLockAsyncResult.cs
- SqlDataAdapter.cs
- ToolTipAutomationPeer.cs
- ActivitiesCollection.cs
- ReplacementText.cs
- RegionIterator.cs
- TaskFileService.cs
- ConfigXmlDocument.cs
- SystemDropShadowChrome.cs
- PopupEventArgs.cs
- ComNativeDescriptor.cs
- BmpBitmapDecoder.cs
- DrawingVisual.cs
- GeneratedCodeAttribute.cs
- CollectionViewGroupRoot.cs
- MissingManifestResourceException.cs
- PrintDialogException.cs
- _ShellExpression.cs
- ColumnResult.cs
- DataGridState.cs
- HandlerFactoryWrapper.cs
- FloaterBaseParagraph.cs
- XmlEncodedRawTextWriter.cs
- WmpBitmapEncoder.cs
- SplineQuaternionKeyFrame.cs
- SchemaCollectionCompiler.cs
- DynamicValueConverter.cs
- StaticResourceExtension.cs
- UserPersonalizationStateInfo.cs
- PageParser.cs
- TemplatedWizardStep.cs
- Win32PrintDialog.cs
- QuaternionConverter.cs
- ClaimComparer.cs
- BamlLocalizableResource.cs
- TextParaLineResult.cs
- MissingManifestResourceException.cs
- TdsRecordBufferSetter.cs
- PropertyEmitter.cs
- CacheDependency.cs
- IncrementalReadDecoders.cs
- SoapUnknownHeader.cs
- Wizard.cs
- GeneralTransformGroup.cs
- ResourceReferenceKeyNotFoundException.cs
- BitmapEffectDrawingContextState.cs
- WorkflowStateRollbackService.cs
- IncrementalReadDecoders.cs
- FigureHelper.cs
- DataSet.cs
- FrameworkRichTextComposition.cs
- MultipartContentParser.cs
- LinqDataSourceSelectEventArgs.cs
- BufferedOutputStream.cs
- HtmlTable.cs
- RichTextBoxConstants.cs
- PrimitiveCodeDomSerializer.cs