Class BasePlugin<TConfigurationType>
Provides a common base class for all plugins
Inherited Members
Namespace: MediaBrowser.Common.Plugins
Assembly: MediaBrowser.Common.dll
Syntax
public abstract class BasePlugin<TConfigurationType> : BasePlugin, IPlugin, IPluginAssembly, IHasPluginConfiguration where TConfigurationType : BasePluginConfigurationType Parameters
| Name | Description | 
|---|---|
| TConfigurationType | The type of the T configuration type. | 
Constructors
BasePlugin(IApplicationPaths, IXmlSerializer)
Initializes a new instance of the BasePlugin<TConfigurationType> class.
Declaration
protected BasePlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)Parameters
| Type | Name | Description | 
|---|---|---|
| IApplicationPaths | applicationPaths | The application paths. | 
| IXmlSerializer | xmlSerializer | The XML serializer. | 
Properties
ApplicationPaths
Gets the application paths.
Declaration
protected IApplicationPaths ApplicationPaths { get; }Property Value
| Type | Description | 
|---|---|
| IApplicationPaths | The application paths. | 
AssemblyFileName
Gets the name the assembly file
Declaration
protected string AssemblyFileName { get; }Property Value
| Type | Description | 
|---|---|
| System.String | The name of the assembly file. | 
Configuration
Gets the plugin's configuration
Declaration
public TConfigurationType Configuration { get; protected set; }Property Value
| Type | Description | 
|---|---|
| TConfigurationType | The configuration. | 
ConfigurationFileName
Gets the name of the configuration file. Subclasses should override
Declaration
public virtual string ConfigurationFileName { get; }Property Value
| Type | Description | 
|---|---|
| System.String | The name of the configuration file. | 
ConfigurationFilePath
Gets the full path to the configuration file
Declaration
public string ConfigurationFilePath { get; }Property Value
| Type | Description | 
|---|---|
| System.String | The configuration file path. | 
ConfigurationType
Gets the type of configuration this plugin uses
Declaration
public Type ConfigurationType { get; }Property Value
| Type | Description | 
|---|---|
| System.Type | The type of the configuration. | 
IsFirstRun
Gets a value indicating whether this instance is first run.
Declaration
public bool IsFirstRun { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
XmlSerializer
Gets the XML serializer.
Declaration
protected IXmlSerializer XmlSerializer { get; }Property Value
| Type | Description | 
|---|---|
| IXmlSerializer | The XML serializer. | 
Methods
GetPluginInfo()
Declaration
public override PluginInfo GetPluginInfo()Returns
| Type | Description | 
|---|---|
| PluginInfo | 
Overrides
SaveConfiguration()
Saves the current configuration to the file system
Declaration
public virtual void SaveConfiguration()SetStartupInfo(Action<String>)
Declaration
public void SetStartupInfo(Action<string> directoryCreateFn)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Action<System.String> | directoryCreateFn | 
UpdateConfiguration(BasePluginConfiguration)
Completely overwrites the current configuration with a new copy Returns true or false indicating success or failure
Declaration
public virtual void UpdateConfiguration(BasePluginConfiguration configuration)Parameters
| Type | Name | Description | 
|---|---|---|
| BasePluginConfiguration | configuration | The configuration. | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | configuration | 
Explicit Interface Implementations
IHasPluginConfiguration.Configuration
Gets the plugin's configuration
Declaration
BasePluginConfiguration IHasPluginConfiguration.Configuration { get; }Returns
| Type | Description | 
|---|---|
| BasePluginConfiguration | The configuration. |