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
- CompositeFontFamily.cs
- _AutoWebProxyScriptWrapper.cs
- DetailsViewDesigner.cs
- RootAction.cs
- XsdBuilder.cs
- XPathDocumentNavigator.cs
- DbConnectionClosed.cs
- Visual3DCollection.cs
- TypeGenericEnumerableViewSchema.cs
- JsonWriterDelegator.cs
- TextEditorDragDrop.cs
- ItemTypeToolStripMenuItem.cs
- ByteConverter.cs
- JsonFaultDetail.cs
- BasicCommandTreeVisitor.cs
- _BufferOffsetSize.cs
- DrawingBrush.cs
- ParserContext.cs
- DataListItemEventArgs.cs
- RowBinding.cs
- COM2FontConverter.cs
- AbstractExpressions.cs
- ResourceContainer.cs
- DataGridItemCollection.cs
- DataGridViewCheckBoxCell.cs
- FileLogRecordEnumerator.cs
- SuppressIldasmAttribute.cs
- XomlDesignerLoader.cs
- StrokeFIndices.cs
- NamespaceTable.cs
- ResXDataNode.cs
- RadioButtonPopupAdapter.cs
- SkipStoryboardToFill.cs
- EventLogPermissionEntryCollection.cs
- VariantWrapper.cs
- PropertyItemInternal.cs
- Function.cs
- HtmlValidatorAdapter.cs
- ResourceDisplayNameAttribute.cs
- SoundPlayer.cs
- WindowHideOrCloseTracker.cs
- WorkflowTimerService.cs
- LogWriteRestartAreaState.cs
- TdsParser.cs
- WindowsFormsLinkLabel.cs
- InstanceLockQueryResult.cs
- WebPartUtil.cs
- FileLoadException.cs
- XmlMtomWriter.cs
- ManualWorkflowSchedulerService.cs
- Point3DConverter.cs
- ManipulationInertiaStartingEventArgs.cs
- WizardForm.cs
- RedirectionProxy.cs
- _TLSstream.cs
- XmlParserContext.cs
- GeometryGroup.cs
- ControlBuilder.cs
- SecurityCapabilities.cs
- TraceHandler.cs
- Page.cs
- ContainerUIElement3D.cs
- Int16Storage.cs
- ParserHooks.cs
- GraphicsState.cs
- Pens.cs
- FilteredXmlReader.cs
- XsltFunctions.cs
- ListViewSelectEventArgs.cs
- DocumentSignatureManager.cs
- SymbolEqualComparer.cs
- ContextMenuAutomationPeer.cs
- ToolStripProgressBar.cs
- Wildcard.cs
- DocumentEventArgs.cs
- TimerElapsedEvenArgs.cs
- DataBoundLiteralControl.cs
- SoapServerProtocol.cs
- UserUseLicenseDictionaryLoader.cs
- LookupNode.cs
- ColumnMapProcessor.cs
- ThrowHelper.cs
- SamlAttribute.cs
- DashStyle.cs
- SystemColors.cs
- XmlSchemaType.cs
- AppSettingsExpressionBuilder.cs
- HandleExceptionArgs.cs
- SrgsElementFactory.cs
- SqlDataSourceView.cs
- CapabilitiesRule.cs
- TypeToken.cs
- EntityContainerRelationshipSet.cs
- TraceListener.cs
- View.cs
- DataGridRelationshipRow.cs
- ObjectViewListener.cs
- SecurityNegotiationException.cs
- SqlIdentifier.cs
- CapabilitiesPattern.cs