C# 클래스 Felinesoft.UmbracoCodeFirst.Attributes.AutoContentAttribute

상속: ContentFactoryAttribute, IInitialisableAttribute
파일 보기 프로젝트 열기: DanMannMann/UmbracoCodeFirst

공개 메소드들

메소드 설명
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