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
- AutomationPatternInfo.cs
- HtmlGenericControl.cs
- Pts.cs
- ObjectFullSpanRewriter.cs
- MembershipValidatePasswordEventArgs.cs
- JsonByteArrayDataContract.cs
- ConstructorArgumentAttribute.cs
- ColorTransformHelper.cs
- PenContexts.cs
- ToolboxService.cs
- Vector3DConverter.cs
- NoneExcludedImageIndexConverter.cs
- IntranetCredentialPolicy.cs
- TransformerTypeCollection.cs
- OdbcConnection.cs
- Point3D.cs
- IntAverageAggregationOperator.cs
- Oid.cs
- ContentPlaceHolder.cs
- CuspData.cs
- ColorTranslator.cs
- CheckBoxDesigner.cs
- BinaryReader.cs
- QilChoice.cs
- TimerElapsedEvenArgs.cs
- filewebrequest.cs
- DictionaryGlobals.cs
- ReadOnlyObservableCollection.cs
- SqlExpressionNullability.cs
- entityreference_tresulttype.cs
- DocumentGrid.cs
- FolderBrowserDialogDesigner.cs
- MarshalByRefObject.cs
- AppDomainProtocolHandler.cs
- LinearGradientBrush.cs
- UrlPath.cs
- ConfigurationLocationCollection.cs
- TreeBuilder.cs
- NetDataContractSerializer.cs
- RowCache.cs
- Italic.cs
- DesignerAdapterAttribute.cs
- DataServiceRequestException.cs
- EntityConnectionStringBuilderItem.cs
- AtomMaterializerLog.cs
- ColorConvertedBitmap.cs
- TextTreeRootTextBlock.cs
- ContractsBCL.cs
- SqlGenerator.cs
- ColorConvertedBitmap.cs
- SiteMapNode.cs
- JavaScriptString.cs
- Utility.cs
- EventSchemaTraceListener.cs
- UpWmlMobileTextWriter.cs
- CompositeDesignerAccessibleObject.cs
- EdgeProfileValidation.cs
- AmbiguousMatchException.cs
- MissingFieldException.cs
- MailMessageEventArgs.cs
- odbcmetadatacolumnnames.cs
- EventDescriptorCollection.cs
- Timer.cs
- OdbcCommandBuilder.cs
- FileDialog_Vista_Interop.cs
- Marshal.cs
- XmlNodeList.cs
- TypefaceMap.cs
- PasswordRecovery.cs
- PageBuildProvider.cs
- TextEditorCharacters.cs
- NameNode.cs
- FillErrorEventArgs.cs
- NetworkInformationException.cs
- QueryResult.cs
- HttpListenerPrefixCollection.cs
- ByteAnimationBase.cs
- InternalConfigHost.cs
- WebReferencesBuildProvider.cs
- DesignerDataTableBase.cs
- XmlToDatasetMap.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- GridViewRowPresenter.cs
- XmlNamespaceDeclarationsAttribute.cs
- ListParaClient.cs
- Visual3DCollection.cs
- NumberFormatInfo.cs
- Timer.cs
- BrowserTree.cs
- Misc.cs
- ExpandCollapsePattern.cs
- DLinqDataModelProvider.cs
- PassportAuthenticationModule.cs
- DLinqTableProvider.cs
- __Filters.cs
- GridToolTip.cs
- Matrix.cs
- SurrogateEncoder.cs
- GlobalizationAssembly.cs
- ProxyHelper.cs