Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / shaperfactory.cs / 1599186 / shaperfactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System.Data.Common.QueryCache; using System.Data.Metadata.Edm; using System.Data.Objects; using System.Data.Objects.Internal; using System.Data.Query.InternalTrees; using System.Diagnostics; using System.Runtime.CompilerServices; namespace System.Data.Common.Internal.Materialization { ////// An immutable type used to generate Shaper instances. /// internal abstract class ShaperFactory { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static ShaperFactory Create(Type elementType, QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { ShaperFactoryCreator creator = (ShaperFactoryCreator)Activator.CreateInstance(typeof(TypedShaperFactoryCreator<>).MakeGenericType(elementType)); return creator.TypedCreate(cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } private abstract class ShaperFactoryCreator { internal abstract ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer); } private sealed class TypedShaperFactoryCreator: ShaperFactoryCreator { public TypedShaperFactoryCreator() {} internal override ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { return Translator.TranslateColumnMap (cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } } } /// /// Typed ShaperFactory /// internal class ShaperFactory: ShaperFactory { private readonly int _stateCount; private readonly CoordinatorFactory _rootCoordinatorFactory; private readonly Action _checkPermissions; private readonly MergeOption _mergeOption; internal ShaperFactory(int stateCount, CoordinatorFactory rootCoordinatorFactory, Action checkPermissions, MergeOption mergeOption) { _stateCount = stateCount; _rootCoordinatorFactory = rootCoordinatorFactory; _checkPermissions = checkPermissions; _mergeOption = mergeOption; } /// /// Factory method to create the Shaper for Object Layer queries. /// internal ShaperCreate(DbDataReader reader, ObjectContext context, MetadataWorkspace workspace, MergeOption mergeOption, bool readerOwned) { Debug.Assert(mergeOption == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, context, workspace, mergeOption, _stateCount, _rootCoordinatorFactory, _checkPermissions, readerOwned); } } } // 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
- Viewport2DVisual3D.cs
- EventManager.cs
- WebPartDisplayMode.cs
- HttpResponseInternalWrapper.cs
- ButtonBaseAdapter.cs
- CompensationParticipant.cs
- CacheAxisQuery.cs
- RegexCode.cs
- FormsAuthentication.cs
- StrongNamePublicKeyBlob.cs
- FormView.cs
- LeftCellWrapper.cs
- DtdParser.cs
- SystemIcons.cs
- ByteStream.cs
- MsmqIntegrationBindingCollectionElement.cs
- StringAnimationUsingKeyFrames.cs
- QueueProcessor.cs
- RenameRuleObjectDialog.cs
- EventDescriptor.cs
- AppearanceEditorPart.cs
- XmlRootAttribute.cs
- PointAnimation.cs
- TextTabProperties.cs
- TableLayoutStyleCollection.cs
- SingleStorage.cs
- PagedDataSource.cs
- Transform.cs
- DesignOnlyAttribute.cs
- HttpServerChannel.cs
- ResourceContainer.cs
- VisualTreeHelper.cs
- ResourcePool.cs
- DebugController.cs
- ToolboxItem.cs
- GlobalizationSection.cs
- SqlBooleanMismatchVisitor.cs
- Transactions.cs
- InstancePersistenceContext.cs
- DATA_BLOB.cs
- CodeSubDirectory.cs
- _Semaphore.cs
- TypeElementCollection.cs
- MulticastDelegate.cs
- HttpClientChannel.cs
- ConfigurationElementCollection.cs
- DataTable.cs
- SqlCacheDependencyDatabase.cs
- DataRecordInternal.cs
- InkCanvasInnerCanvas.cs
- FlowDocument.cs
- CodeAttributeDeclarationCollection.cs
- ConfigurationLocation.cs
- FormViewUpdatedEventArgs.cs
- RSAOAEPKeyExchangeFormatter.cs
- TypeInformation.cs
- SystemWebSectionGroup.cs
- Control.cs
- Expressions.cs
- ClassImporter.cs
- WindowsStatusBar.cs
- AddInAdapter.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- GreenMethods.cs
- unitconverter.cs
- SqlTriggerAttribute.cs
- WebRequestModuleElement.cs
- LicenseException.cs
- WebMessageEncodingElement.cs
- SecurityPolicySection.cs
- ExpressionLink.cs
- XmlTextReaderImplHelpers.cs
- ValidationSummary.cs
- SupportsEventValidationAttribute.cs
- DataGridViewRowStateChangedEventArgs.cs
- FixedSOMImage.cs
- DataSourceExpression.cs
- Visual3DCollection.cs
- DeviceSpecificChoiceCollection.cs
- unitconverter.cs
- DoubleLinkList.cs
- DateTimeFormatInfoScanner.cs
- GroupBoxAutomationPeer.cs
- CharacterMetrics.cs
- GraphicsContainer.cs
- DefaultTextStoreTextComposition.cs
- DoubleConverter.cs
- X509PeerCertificateElement.cs
- BaseAsyncResult.cs
- KoreanCalendar.cs
- WebPartMenuStyle.cs
- DataGridViewTextBoxColumn.cs
- SqlCacheDependency.cs
- DemultiplexingClientMessageFormatter.cs
- FormsAuthentication.cs
- InvokeProviderWrapper.cs
- TextEditorContextMenu.cs
- TransactionBridge.cs
- QueryPageSettingsEventArgs.cs
- IndentedWriter.cs