C# Class BlogEngine.Core.Web.Extensions.ExtensionManager

Afficher le fichier Open project: rasmuskl/ReSharperCourse

Private Properties

Свойство Type Description
DataStoreExtension BlogEngine.Core.Web.Extensions.ManagedExtension
IsNewExtension bool
LoadExtensions void
SaveToCache void

Méthodes publiques

Méthode Description
ChangeStatus ( string extension, bool enabled ) : void

Method to change extension status

Contains ( Type type ) : bool

Tell if manager already has this extension

ExtensionEnabled ( string extensionName ) : bool

Enabled / Disabled

GetExtension ( string extensionName ) : BlogEngine.Core.Web.Extensions.ManagedExtension

Returns extension to the client based on name

GetSettings ( string extensionName ) : BlogEngine.Core.Web.Extensions.ExtensionSettings

Method to get settings collection

GetSettings ( string extensionName, string settingName ) : BlogEngine.Core.Web.Extensions.ExtensionSettings

Returns settings for specified extension

ImportSettings ( BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : bool

Do initial import here. If already imported, let extension manager take care of settings To reset, blogger has to delete all settings in the manager

ImportSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : bool

Imports the settings.

InitSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : BlogEngine.Core.Web.Extensions.ExtensionSettings

Initializes settings by importing default parameters

Save ( ) : void

Will serialize and cache ext. mgr. object

SaveSettings ( BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : void

Will save settings (add to extension object, then cache and serialize all object hierarhy to XML)

SaveSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : void

The save settings.

SaveToStorage ( ) : bool

Saves ext. manager object to XML file or database table using provider model

SaveToStorage ( BlogEngine.Core.Web.Extensions.ManagedExtension ext ) : bool

Save individual extension to storage

SetAdminPage ( string extension, string url ) : void

A way to let extension author to use custom admin page. Will show up as link on extensions page

SetStatus ( string extension, bool enabled ) : void

Only change status on first load; This allows to enable/disable extension on initial load and then be able to override it with change status from admin interface

ShowSettings ( string extensionName, bool flag ) : void

Show of hide settings in the admin/extensions list

Private Methods

Méthode Description
DataStoreExtension ( string name ) : BlogEngine.Core.Web.Extensions.ManagedExtension

Returns extension object

IsNewExtension ( string name ) : bool

Extension is "new" if it is loaded from assembly but not yet saved to the disk. This state is needed so that we can initialize extension and its settings on the first load and then override it from admin

LoadExtensions ( ) : void

If extensions not in the cache will load from the XML file. If file not exists will load from assembly using reflection

SaveToCache ( ) : void

Caches for performance. If manager cached and not updates done, chached copy always returned

Method Details

ChangeStatus() public static méthode

Method to change extension status
public static ChangeStatus ( string extension, bool enabled ) : void
extension string /// Extensio Name ///
enabled bool /// If true, enables extension ///
Résultat void

Contains() public static méthode

Tell if manager already has this extension
public static Contains ( Type type ) : bool
type System.Type /// Extension Type ///
Résultat bool

ExtensionEnabled() public static méthode

Enabled / Disabled
public static ExtensionEnabled ( string extensionName ) : bool
extensionName string /// Name of the extension. ///
Résultat bool

GetExtension() public static méthode

Returns extension to the client based on name
public static GetExtension ( string extensionName ) : BlogEngine.Core.Web.Extensions.ManagedExtension
extensionName string /// Extension name ///
Résultat BlogEngine.Core.Web.Extensions.ManagedExtension

GetSettings() public static méthode

Method to get settings collection
public static GetSettings ( string extensionName ) : BlogEngine.Core.Web.Extensions.ExtensionSettings
extensionName string /// Extension Name ///
Résultat BlogEngine.Core.Web.Extensions.ExtensionSettings

GetSettings() public static méthode

Returns settings for specified extension
public static GetSettings ( string extensionName, string settingName ) : BlogEngine.Core.Web.Extensions.ExtensionSettings
extensionName string /// Extension Name ///
settingName string /// Settings Name ///
Résultat BlogEngine.Core.Web.Extensions.ExtensionSettings

ImportSettings() public static méthode

Do initial import here. If already imported, let extension manager take care of settings To reset, blogger has to delete all settings in the manager
public static ImportSettings ( BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : bool
settings BlogEngine.Core.Web.Extensions.ExtensionSettings /// The settings. ///
Résultat bool

ImportSettings() public static méthode

Imports the settings.
public static ImportSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : bool
extensionName string /// Name of the extension. ///
settings BlogEngine.Core.Web.Extensions.ExtensionSettings /// The settings. ///
Résultat bool

InitSettings() public static méthode

Initializes settings by importing default parameters
public static InitSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : BlogEngine.Core.Web.Extensions.ExtensionSettings
extensionName string /// Extension Name ///
settings BlogEngine.Core.Web.Extensions.ExtensionSettings /// Settings object ///
Résultat BlogEngine.Core.Web.Extensions.ExtensionSettings

Save() public static méthode

Will serialize and cache ext. mgr. object
public static Save ( ) : void
Résultat void

SaveSettings() public static méthode

Will save settings (add to extension object, then cache and serialize all object hierarhy to XML)
public static SaveSettings ( BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : void
settings BlogEngine.Core.Web.Extensions.ExtensionSettings /// Settings object ///
Résultat void

SaveSettings() public static méthode

The save settings.
public static SaveSettings ( string extensionName, BlogEngine.Core.Web.Extensions.ExtensionSettings settings ) : void
extensionName string /// The extension name. ///
settings BlogEngine.Core.Web.Extensions.ExtensionSettings /// The settings. ///
Résultat void

SaveToStorage() public static méthode

Saves ext. manager object to XML file or database table using provider model
public static SaveToStorage ( ) : bool
Résultat bool

SaveToStorage() public static méthode

Save individual extension to storage
public static SaveToStorage ( BlogEngine.Core.Web.Extensions.ManagedExtension ext ) : bool
ext BlogEngine.Core.Web.Extensions.ManagedExtension /// The Extension ///
Résultat bool

SetAdminPage() public static méthode

A way to let extension author to use custom admin page. Will show up as link on extensions page
public static SetAdminPage ( string extension, string url ) : void
extension string /// Extension Name ///
url string /// Path to custom admin page ///
Résultat void

SetStatus() public static méthode

Only change status on first load; This allows to enable/disable extension on initial load and then be able to override it with change status from admin interface
public static SetStatus ( string extension, bool enabled ) : void
extension string /// Extension Name ///
enabled bool /// Enable/disable extension on initial load ///
Résultat void

ShowSettings() public static méthode

Show of hide settings in the admin/extensions list
public static ShowSettings ( string extensionName, bool flag ) : void
extensionName string /// Extension name ///
flag bool /// True of false ///
Résultat void