C# Class Plugin.PluginManager

插件管理器。
显示文件 Open project: Silveryard/SmartHome

Public Methods

Method Description
GetPlugin ( string plugin ) : Plugin

Returns the plugin with a specific name

LoadFromDir ( DirectoryInfo dir ) : void

Loads all plugins in the specified directory

UnloadAll ( ) : void

Unloads all plugins

Private Methods

Method Description
LoadFromDir ( DirectoryInfo dir, List &unloadablePlugins ) : void

Loads all plugins in a directory

LoadFromDirAsync ( object odir ) : void
LoadTypes ( DirectoryInfo dir ) : List

Loads all types from all files in a dir

NeededPluginsLoaded ( Type plugin, List plugins ) : bool

Checks if all of a plugins needed plugins are already loaded. Will return true if the type is no subclass of Plugin or does not have any NeedsPlugin attributes

PluginLoaded ( string plugin, List plugins ) : bool

Checks if a plugin is already loaded

Unload ( List plugins ) : void

Method Details

GetPlugin() public static method

Returns the plugin with a specific name
public static GetPlugin ( string plugin ) : Plugin
plugin string The plugins name
return Plugin

LoadFromDir() public static method

Loads all plugins in the specified directory
public static LoadFromDir ( DirectoryInfo dir ) : void
dir System.IO.DirectoryInfo The target directory
return void

UnloadAll() public static method

Unloads all plugins
public static UnloadAll ( ) : void
return void