Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / shaperfactory.cs / 1 / 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; namespace System.Data.Common.Internal.Materialization { ////// An immutable type used to generate Shaper instances. /// internal abstract class ShaperFactory { 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) { 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); } /// /// Factory method to create the Shaper for Value Layer queries. /// internal ShaperCreate(DbDataReader reader, MetadataWorkspace workspace) { Debug.Assert(MergeOption.NoTracking == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, null, workspace, MergeOption.NoTracking, _stateCount, _rootCoordinatorFactory, _checkPermissions); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // 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; namespace System.Data.Common.Internal.Materialization { ////// An immutable type used to generate Shaper instances. /// internal abstract class ShaperFactory { 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) { 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); } /// /// Factory method to create the Shaper for Value Layer queries. /// internal ShaperCreate(DbDataReader reader, MetadataWorkspace workspace) { Debug.Assert(MergeOption.NoTracking == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, null, workspace, MergeOption.NoTracking, _stateCount, _rootCoordinatorFactory, _checkPermissions); } } } // 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
- StorageMappingItemLoader.cs
- DataGridItemCollection.cs
- ProviderConnectionPointCollection.cs
- UnsafeNativeMethodsTablet.cs
- SendActivityEventArgs.cs
- BamlBinaryWriter.cs
- WebBrowserContainer.cs
- HwndTarget.cs
- XmlSignificantWhitespace.cs
- LinkButton.cs
- SimpleWebHandlerParser.cs
- DataReaderContainer.cs
- DatagridviewDisplayedBandsData.cs
- PolyQuadraticBezierSegment.cs
- Pen.cs
- PartialCachingAttribute.cs
- WindowsGraphics2.cs
- NotFiniteNumberException.cs
- BitmapEffectCollection.cs
- StringHandle.cs
- StringUtil.cs
- JoinSymbol.cs
- LoaderAllocator.cs
- TripleDESCryptoServiceProvider.cs
- SqlWebEventProvider.cs
- FileDetails.cs
- EventProxy.cs
- EmissiveMaterial.cs
- SqlXml.cs
- TraceUtility.cs
- FileUpload.cs
- GreenMethods.cs
- MemoryStream.cs
- HttpClientCredentialType.cs
- UIElementAutomationPeer.cs
- DropShadowEffect.cs
- InheritanceContextChangedEventManager.cs
- WebPartTransformer.cs
- FreezableCollection.cs
- ExpandedProjectionNode.cs
- TransportOutputChannel.cs
- KnownTypes.cs
- StorageEntityTypeMapping.cs
- ActivationWorker.cs
- ManipulationStartedEventArgs.cs
- SqlRowUpdatingEvent.cs
- TcpClientChannel.cs
- ProviderIncompatibleException.cs
- SapiRecoInterop.cs
- SecurityMode.cs
- ServiceRouteHandler.cs
- OleDbPermission.cs
- MethodImplAttribute.cs
- IDQuery.cs
- DesignerAttribute.cs
- SingleAnimation.cs
- RelationshipManager.cs
- DataGridViewButtonColumn.cs
- FormParameter.cs
- CaseCqlBlock.cs
- ZipFileInfoCollection.cs
- NetStream.cs
- InternalSendMessage.cs
- DbModificationClause.cs
- WebScriptEnablingElement.cs
- XmlDataImplementation.cs
- WorkflowServiceInstance.cs
- SizeF.cs
- XmlSchemaAny.cs
- RelationshipEnd.cs
- ParallelTimeline.cs
- WindowProviderWrapper.cs
- FieldNameLookup.cs
- StringDictionary.cs
- CustomTrackingQuery.cs
- FullTextState.cs
- CodeAttributeArgument.cs
- ControlCollection.cs
- METAHEADER.cs
- TaiwanCalendar.cs
- EventLevel.cs
- Select.cs
- DataSourceGroupCollection.cs
- WindowShowOrOpenTracker.cs
- PageCatalogPart.cs
- PageVisual.cs
- ParseHttpDate.cs
- DataPagerCommandEventArgs.cs
- AttributeCollection.cs
- GridViewRowEventArgs.cs
- ExpressionVisitor.cs
- NameTable.cs
- DesignerTextViewAdapter.cs
- DoubleAnimation.cs
- GenericTypeParameterBuilder.cs
- FixedPosition.cs
- ProjectionPlanCompiler.cs
- XsltQilFactory.cs
- TcpClientSocketManager.cs
- AggregateNode.cs