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
- XMLDiffLoader.cs
- RegexRunner.cs
- XmlSchemaCompilationSettings.cs
- DiscreteKeyFrames.cs
- DesignTimeParseData.cs
- ScrollContentPresenter.cs
- DecimalStorage.cs
- SafeNativeMethodsOther.cs
- TransactionWaitAsyncResult.cs
- ObjectDataSourceSelectingEventArgs.cs
- ComboBoxAutomationPeer.cs
- CellParaClient.cs
- IdleTimeoutMonitor.cs
- HttpModuleAction.cs
- OracleBFile.cs
- _CookieModule.cs
- followingquery.cs
- GridViewUpdateEventArgs.cs
- TargetParameterCountException.cs
- DataServiceHostFactory.cs
- X509ThumbprintKeyIdentifierClause.cs
- ChainOfDependencies.cs
- CompleteWizardStep.cs
- CodePageUtils.cs
- ClickablePoint.cs
- ResourceSet.cs
- FixedFindEngine.cs
- ProfileGroupSettings.cs
- SiteMapSection.cs
- InternalBufferManager.cs
- ServiceHttpModule.cs
- CompressStream.cs
- CodeExporter.cs
- IntSecurity.cs
- HttpModuleCollection.cs
- KeyValuePairs.cs
- ServerValidateEventArgs.cs
- ManifestResourceInfo.cs
- SurrogateSelector.cs
- EventDescriptor.cs
- ListBase.cs
- HelloMessageApril2005.cs
- TypeLoadException.cs
- selecteditemcollection.cs
- SchemaType.cs
- _CacheStreams.cs
- CodePropertyReferenceExpression.cs
- XmlSchemaSimpleContentExtension.cs
- CodeTypeConstructor.cs
- SiteIdentityPermission.cs
- MobileSysDescriptionAttribute.cs
- TextBoxRenderer.cs
- AlignmentYValidation.cs
- OrderedDictionary.cs
- IgnoreFileBuildProvider.cs
- ObjectItemCachedAssemblyLoader.cs
- TransactionInterop.cs
- XmlSchemaCollection.cs
- MsmqDecodeHelper.cs
- AppDomainAttributes.cs
- EntityDataSourceWizardForm.cs
- DependencyObjectPropertyDescriptor.cs
- SafeNativeMethods.cs
- Timeline.cs
- ListChangedEventArgs.cs
- Script.cs
- TargetInvocationException.cs
- DispatchWrapper.cs
- Int64AnimationUsingKeyFrames.cs
- parserscommon.cs
- ForEachAction.cs
- SspiHelper.cs
- EntityDataSourceContextDisposingEventArgs.cs
- Translator.cs
- TemplateXamlParser.cs
- FileLogRecord.cs
- TypeConverterHelper.cs
- DataBoundControlParameterTarget.cs
- TypedRowGenerator.cs
- NullToBooleanConverter.cs
- BulletedList.cs
- AssociatedControlConverter.cs
- Transform3D.cs
- ConfigXmlComment.cs
- PagedDataSource.cs
- MachineKeySection.cs
- DataViewManagerListItemTypeDescriptor.cs
- x509utils.cs
- TcpAppDomainProtocolHandler.cs
- SafeFileMappingHandle.cs
- RegexCharClass.cs
- RegexGroup.cs
- CalendarDay.cs
- Utils.cs
- FixedTextSelectionProcessor.cs
- CmsInterop.cs
- HtmlElement.cs
- path.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- Span.cs