C# Class Felinesoft.UmbracoCodeFirst.CodeFirstManager

Manages the UmbracoCodeFirst core, allowing data type registration and content type and instance discovery and creation.
Exibir arquivo Open project: DanMannMann/UmbracoCodeFirst Class Usage Examples

Public Methods

Method Description
GenerateTypeFilesFromDatabase ( string folderPath, string nameSpace = "UmbracoCodeFirst.GeneratedTypes" ) : void
Initialise ( Assembly assembly, bool refreshCache = true ) : void

Scans the supplied assembly for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the assembly should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.

Initialise ( IEnumerable assemblies, bool refreshCache = true ) : void

Scans the supplied collection of assemblies for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the collection should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.

Initialise ( IEnumerable types, bool refreshCache = true ) : void

Scans the supplied collection of types for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the collection should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.

Invalidate ( ) : void
Log ( string message, object source, [ sourceMethod = null ) : void
Warn ( string message, object source, [ sourceMethod = null ) : void

Private Methods

Method Description
CodeFirstManager ( ) : System

Constructs the singleton instance

CodeFirstManager_Invalidating ( object sender, InvalidatingEventArgs e ) : void
FilterTreeNodes ( Umbraco.Web.Trees.TreeControllerBase sender, Umbraco.Web.Trees.TreeNodesRenderingEventArgs e ) : void
InitialiseModules ( IEnumerable types ) : void

Method Details

GenerateTypeFilesFromDatabase() public method

public GenerateTypeFilesFromDatabase ( string folderPath, string nameSpace = "UmbracoCodeFirst.GeneratedTypes" ) : void
folderPath string
nameSpace string
return void

Initialise() public method

Scans the supplied assembly for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the assembly should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.
public Initialise ( Assembly assembly, bool refreshCache = true ) : void
assembly System.Reflection.Assembly The assembly to scan
refreshCache bool True to refresh the Umbraco XML cache after creating document instances
return void

Initialise() public method

Scans the supplied collection of assemblies for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the collection should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.
public Initialise ( IEnumerable assemblies, bool refreshCache = true ) : void
assemblies IEnumerable The assemblies to scan
refreshCache bool True to refresh the Umbraco XML cache after creating document instances
return void

Initialise() public method

Scans the supplied collection of types for code-first document types, media types, data types and document instances. All items are added or updated before control is returned; after running this method all code-first items found in the collection should exist in Umbraco. It is important to include *all* required elements in a single call to initialise; custom data types used within a document type must be available when the document type is created.
public Initialise ( IEnumerable types, bool refreshCache = true ) : void
types IEnumerable The types to scan
refreshCache bool True to refresh the Umbraco XML cache after creating document instances
return void

Invalidate() public static method

public static Invalidate ( ) : void
return void

Log() public method

public Log ( string message, object source, [ sourceMethod = null ) : void
message string
source object
sourceMethod [
return void

Warn() public method

public Warn ( string message, object source, [ sourceMethod = null ) : void
message string
source object
sourceMethod [
return void