November Happy Hour will be moved to Thursday December 5th.

Class ContentTypeModelScanner

Creates a ContentTypeModelRegister and feeds it the ContentTypeModels stored in the IScannedTypeRepository.

Inheritance
System.Object
ContentTypeModelScanner
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
[ServiceConfiguration(typeof(IContentTypeModelScanner))]
[ServiceConfiguration(typeof(ContentTypeModelScanner))]
public class ContentTypeModelScanner : IContentTypeModelScanner

Constructors

ContentTypeModelScanner(ITypeScannerLookup, ContentTypeModelRegister, ContentModelValidator, ContentTypeModelRepository, IContentTypeModelAssigner, ContentDataInterceptorHandler, ContentDataInterceptor, TemplateModelRepository, IContentTypeModelFilter[], IEnumerable<ContentScannerExtension>, IAvailableModelSettingsRepository)

Initializes a new instance of the ContentTypeModelScanner class.

Declaration
public ContentTypeModelScanner(ITypeScannerLookup typeScannerLookup, ContentTypeModelRegister typeModelRegister, ContentModelValidator modelValidator, ContentTypeModelRepository contentTypeModelRepository, IContentTypeModelAssigner contentTypeModelAssigner, ContentDataInterceptorHandler modelTypeInterceptorHandler, ContentDataInterceptor modelTypeInterceptor, TemplateModelRepository templateModelRepository, IContentTypeModelFilter[] filters, IEnumerable<ContentScannerExtension> registerExtensions, IAvailableModelSettingsRepository availableContentTypeService)
Parameters
Type Name Description
ITypeScannerLookup typeScannerLookup

The scanned type repository.

ContentTypeModelRegister typeModelRegister

The content type model synchronizer.

ContentModelValidator modelValidator

The model validator.

ContentTypeModelRepository contentTypeModelRepository

The content type model repository.

IContentTypeModelAssigner contentTypeModelAssigner

The content type model assigner.

ContentDataInterceptorHandler modelTypeInterceptorHandler

The model type interceptor handler.

ContentDataInterceptor modelTypeInterceptor

The model type interceptor.

TemplateModelRepository templateModelRepository

The render template repository.

IContentTypeModelFilter[] filters

The filters to get the content types to synchronize

System.Collections.Generic.IEnumerable<ContentScannerExtension> registerExtensions

The register extensions.

IAvailableModelSettingsRepository availableContentTypeService

Register available content types

ContentTypeModelScanner(ITypeScannerLookup, ContentTypeModelRegister, ContentModelValidator, ContentTypeModelRepository, IContentTypeModelAssigner, ContentDataInterceptorHandler, ContentDataInterceptor, TemplateModelRepository, IContentTypeModelFilter[], IEnumerable<ContentScannerExtension>, IAvailableModelSettingsRepository, IContentTypeModelScannerEventsRaiser)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the ContentTypeModelScanner class.

Declaration
public ContentTypeModelScanner(ITypeScannerLookup typeScannerLookup, ContentTypeModelRegister typeModelRegister, ContentModelValidator modelValidator, ContentTypeModelRepository contentTypeModelRepository, IContentTypeModelAssigner contentTypeModelAssigner, ContentDataInterceptorHandler modelTypeInterceptorHandler, ContentDataInterceptor modelTypeInterceptor, TemplateModelRepository templateModelRepository, IContentTypeModelFilter[] filters, IEnumerable<ContentScannerExtension> registerExtensions, IAvailableModelSettingsRepository availableContentTypeService, IContentTypeModelScannerEventsRaiser contentTypeModelScannerEvents)
Parameters
Type Name Description
ITypeScannerLookup typeScannerLookup

The scanned type repository.

ContentTypeModelRegister typeModelRegister

The content type model synchronizer.

ContentModelValidator modelValidator

The model validator.

ContentTypeModelRepository contentTypeModelRepository

The content type model repository.

IContentTypeModelAssigner contentTypeModelAssigner

The content type model assigner.

ContentDataInterceptorHandler modelTypeInterceptorHandler

The model type interceptor handler.

ContentDataInterceptor modelTypeInterceptor

The model type interceptor.

TemplateModelRepository templateModelRepository

The render template repository.

IContentTypeModelFilter[] filters

The filters to get the content types to synchronize

System.Collections.Generic.IEnumerable<ContentScannerExtension> registerExtensions

The register extensions.

IAvailableModelSettingsRepository availableContentTypeService

Register available content types

IContentTypeModelScannerEventsRaiser contentTypeModelScannerEvents

Event handling for ContentType model scanner.

Properties

ContentTypes

Gets content types in the system.

Declaration
public virtual IEnumerable<Type> ContentTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

DeleteUnusedContentTypes

Gets a value indicating whether unused content types should be deleted

Declaration
protected virtual bool DeleteUnusedContentTypes { get; }
Property Value
Type Description
System.Boolean

true if unused content types should be deleted; otherwise, false.

Remarks

returns true.

IgnoredTypes

Gets the types that are ignored during scanning.

Declaration
public virtual IEnumerable<Type> IgnoredTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The ignored types.

Remarks

By default this is system types like PageData and BlockData

RunSynchronously

If methods should run without parallellism

Declaration
public bool RunSynchronously { get; set; }
Property Value
Type Description
System.Boolean

Methods

AddModel(Type)

Adds a model with the specified type.

Declaration
public virtual void AddModel(Type type)
Parameters
Type Name Description
System.Type type

The type.

AssignAvailableTypes(ContentTypeModel)

Register settings for which types that should be available under a specific type.

Declaration
protected virtual void AssignAvailableTypes(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

AssignValuesToModel(ContentTypeModel)

Creates a type model and adds it to the collection of types.

Declaration
protected virtual void AssignValuesToModel(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

AssignValuesToProperties(ContentTypeModel)

Assigns values to modelType.

Declaration
protected virtual void AssignValuesToProperties(ContentTypeModel modelType)
Parameters
Type Name Description
ContentTypeModel modelType

Type of the model.

CreateModel(Type)

Creates a model.

Declaration
protected virtual ContentTypeModel CreateModel(Type type)
Parameters
Type Name Description
System.Type type

The type to create the model from.

Returns
Type Description
ContentTypeModel

EagerCompileProxies()

Creates a task that compiles proxies for all types that has automatic getters/setters.

Declaration
protected virtual void EagerCompileProxies()

GetProperties(ContentTypeModel)

Gets properties on the modelType.

Declaration
public virtual IEnumerable<PropertyInfo> GetProperties(ContentTypeModel modelType)
Parameters
Type Name Description
ContentTypeModel modelType

The model to get properties from.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>

Register(ContentTypeModel)

Registers the specified type model.

Declaration
protected virtual void Register(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

RegisterModels()

Registers the models with the repositories.

Declaration
public virtual IList<Task> RegisterModels()
Returns
Type Description
System.Collections.Generic.IList<System.Threading.Tasks.Task>

A list of started tasks.

Remarks

The registration is complete when all returned task are completed.

Sync(Boolean)

Creates ContentTypeModels from the relevant types stored in the IScannedTypeRepository and passes them to the ContentTypeModelRegister.

Declaration
public virtual IList<Task> Sync(bool commitChanges)
Parameters
Type Name Description
System.Boolean commitChanges

if set to true then stores in repository.

Returns
Type Description
System.Collections.Generic.IList<System.Threading.Tasks.Task>

A list of started tasks.

Remarks

The registration is complete when all returned task are completed.

Implements

Extension Methods