C# Класс BlogEngine.Core.Web.Extensions.ExtensionManager

Показать файл Открыть проект

Private Properties

Свойство Тип Описание
DataStoreExtension BlogEngine.Core.Web.Extensions.ManagedExtension
IsNewExtension bool
LoadExtensions void
SaveToCache void

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

Метод Описание
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

Приватные методы

Метод Описание
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

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

ChangeStatus() публичный статический Метод

Method to change extension status
public static ChangeStatus ( string extension, bool enabled ) : void
extension string /// Extensio Name ///
enabled bool /// If true, enables extension ///
Результат void

Contains() публичный статический Метод

Tell if manager already has this extension
public static Contains ( Type type ) : bool
type System.Type /// Extension Type ///
Результат bool

ExtensionEnabled() публичный статический Метод

Enabled / Disabled
public static ExtensionEnabled ( string extensionName ) : bool
extensionName string /// Name of the extension. ///
Результат bool

GetExtension() публичный статический Метод

Returns extension to the client based on name
public static GetExtension ( string extensionName ) : BlogEngine.Core.Web.Extensions.ManagedExtension
extensionName string /// Extension name ///
Результат BlogEngine.Core.Web.Extensions.ManagedExtension

GetSettings() публичный статический Метод

Method to get settings collection
public static GetSettings ( string extensionName ) : BlogEngine.Core.Web.Extensions.ExtensionSettings
extensionName string /// Extension Name ///
Результат BlogEngine.Core.Web.Extensions.ExtensionSettings

GetSettings() публичный статический Метод

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 ///
Результат BlogEngine.Core.Web.Extensions.ExtensionSettings

ImportSettings() публичный статический Метод

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. ///
Результат bool

ImportSettings() публичный статический Метод

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. ///
Результат bool

InitSettings() публичный статический Метод

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 ///
Результат BlogEngine.Core.Web.Extensions.ExtensionSettings

Save() публичный статический Метод

Will serialize and cache ext. mgr. object
public static Save ( ) : void
Результат void

SaveSettings() публичный статический Метод

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 ///
Результат void

SaveSettings() публичный статический Метод

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. ///
Результат void

SaveToStorage() публичный статический Метод

Saves ext. manager object to XML file or database table using provider model
public static SaveToStorage ( ) : bool
Результат bool

SaveToStorage() публичный статический Метод

Save individual extension to storage
public static SaveToStorage ( BlogEngine.Core.Web.Extensions.ManagedExtension ext ) : bool
ext BlogEngine.Core.Web.Extensions.ManagedExtension /// The Extension ///
Результат bool

SetAdminPage() публичный статический Метод

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 ///
Результат void

SetStatus() публичный статический Метод

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 ///
Результат void

ShowSettings() публичный статический Метод

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 ///
Результат void