C# Класс Felinesoft.UmbracoCodeFirst.Attributes.AutoContentAttribute

Наследование: ContentFactoryAttribute, IInitialisableAttribute
Показать файл Открыть проект

Открытые методы

Метод Описание
AutoContentAttribute ( string name, Type parentType = null, int sortOrder = 10 ) : System

When applied to a code-first document type class this attribute instructs the code-first initialiser to create a document instance of that type, if it does not exist. This attribute should only be applied to classes which inherit DocumentTypeBase and which also have a [DocumentType] attribute.

The values for the document instance can either be configured in a parameterless constructor of the document type class or in the InitialiseDefaults method if the class implements IAutoContent

Initialise ( Type targetType ) : void

Initialises the Factory property based on the type to which the attribute is applied.

Защищенные методы

Метод Описание
ConstructFactory ( DocumentTypeBase values ) : IContentFactory

Automatically constructs a factory for any inheritor of DocumentTypeBase

GetValues ( Type targetType ) : DocumentTypeBase

Gets the document instance values for use in creating the default content

Описание методов

AutoContentAttribute() публичный Метод

When applied to a code-first document type class this attribute instructs the code-first initialiser to create a document instance of that type, if it does not exist. This attribute should only be applied to classes which inherit DocumentTypeBase and which also have a [DocumentType] attribute.

The values for the document instance can either be configured in a parameterless constructor of the document type class or in the InitialiseDefaults method if the class implements IAutoContent

public AutoContentAttribute ( string name, Type parentType = null, int sortOrder = 10 ) : System
name string The name of the document node
parentType System.Type /// The type whose default document will be the parent of this document. /// The supplied type must inherit DocumentTypeBase and must specify a default content provider via an [AutoContent] or [ContentFactory] attribute ///
sortOrder int The sort order for the document amongst its' siblings
Результат System

ConstructFactory() защищенный Метод

Automatically constructs a factory for any inheritor of DocumentTypeBase
protected ConstructFactory ( DocumentTypeBase values ) : IContentFactory
values DocumentTypeBase The document type to create
Результат IContentFactory

GetValues() защищенный Метод

Gets the document instance values for use in creating the default content
protected GetValues ( Type targetType ) : DocumentTypeBase
targetType System.Type The document type
Результат DocumentTypeBase

Initialise() публичный Метод

Initialises the Factory property based on the type to which the attribute is applied.
public Initialise ( Type targetType ) : void
targetType System.Type The type to which the attribute is applied
Результат void