Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- dataobject.cs
- RectAnimationBase.cs
- TreeNodeCollectionEditor.cs
- TextPointerBase.cs
- TimerEventSubscription.cs
- WebPartMovingEventArgs.cs
- Binding.cs
- BitmapVisualManager.cs
- ActivityWithResultWrapper.cs
- SaveFileDialog.cs
- DataObject.cs
- JsonReader.cs
- EditingCommands.cs
- WindowsStatic.cs
- TextSpan.cs
- DocumentViewerBaseAutomationPeer.cs
- PagedDataSource.cs
- RuleSettings.cs
- RowType.cs
- NativeCompoundFileAPIs.cs
- User.cs
- HostVisual.cs
- ServiceCredentialsElement.cs
- RSAOAEPKeyExchangeFormatter.cs
- XslAst.cs
- returneventsaver.cs
- _Semaphore.cs
- MostlySingletonList.cs
- MeshGeometry3D.cs
- MergeExecutor.cs
- SchemaType.cs
- FixedNode.cs
- Pair.cs
- WindowAutomationPeer.cs
- UIPropertyMetadata.cs
- SettingsSection.cs
- SrgsRulesCollection.cs
- RijndaelManagedTransform.cs
- DataTableReader.cs
- RoutedEventHandlerInfo.cs
- TraceInternal.cs
- HexParser.cs
- ScriptingSectionGroup.cs
- Resources.Designer.cs
- SimpleNameService.cs
- TreeNodeCollection.cs
- GenericNameHandler.cs
- UrlRoutingModule.cs
- ScriptControlManager.cs
- SmiRequestExecutor.cs
- Publisher.cs
- NativeMsmqMessage.cs
- ProviderConnectionPoint.cs
- WebService.cs
- EditorPartChrome.cs
- OutputCacheSettings.cs
- DataServiceContext.cs
- ManifestResourceInfo.cs
- Models.cs
- CorrelationToken.cs
- RootBrowserWindowAutomationPeer.cs
- FontUnit.cs
- LazyTextWriterCreator.cs
- SignerInfo.cs
- TextBoxRenderer.cs
- XmlDataProvider.cs
- DrawListViewSubItemEventArgs.cs
- Transform3DGroup.cs
- TrackingMemoryStreamFactory.cs
- Normalization.cs
- BindUriHelper.cs
- storagemappingitemcollection.viewdictionary.cs
- UInt64Storage.cs
- EdgeModeValidation.cs
- IMembershipProvider.cs
- TogglePattern.cs
- Pair.cs
- WhitespaceRuleReader.cs
- XsltException.cs
- Mutex.cs
- CodeMethodInvokeExpression.cs
- X509CertificateCollection.cs
- Codec.cs
- ObjectStorage.cs
- xmlsaver.cs
- SpellerStatusTable.cs
- MatrixIndependentAnimationStorage.cs
- ArrowControl.xaml.cs
- AsyncDataRequest.cs
- TextAdaptor.cs
- DataExpression.cs
- GregorianCalendar.cs
- XPathBinder.cs
- DrawingImage.cs
- DummyDataSource.cs
- OleDbRowUpdatingEvent.cs
- UpdateTranslator.cs
- SizeConverter.cs
- HighlightComponent.cs
- HandlerFactoryCache.cs