Interface IManager
Interface for a manager that handles manageable objects.
public interface IManager : IManageable
- Extension Methods
Properties
IsInitialized
Indicates whether the manager is initialized.
bool IsInitialized { get; }
Property Value
IsLoaded
Indicates whether the manager is finished loading.
bool IsLoaded { get; }
Property Value
IsReady
Indicates whether the manager is ready to be used.
bool IsReady { get; }
Property Value
UnsubscribeEventsOnRemoval
Indicates whether the manager should unsubscribe from events when manageable objects are removed.
bool UnsubscribeEventsOnRemoval { get; }
Property Value
Methods
Add<TX>(IPlugin, Type, bool)
Get a manageable object of the given type.
void Add<TX>(IPlugin plugin, Type type, bool failIfExists = true) where TX : IManageable
Parameters
plugin
IPluginThe plugin that is requesting the manageable object.
type
TypeThe type of the manageable object to get.
failIfExists
boolIf true, will throw an exception if the manageable object already exists.
Type Parameters
TX
Type of the manageable object to get, must implement IManageable.
AssignDependentPlugins(Type, List<IPlugin>)
Assign a list of dependent plugins to the given type.
void AssignDependentPlugins(Type type, List<IPlugin> dependentPlugins)
Parameters
Count()
Count the number of manageable objects that are managed by this manager.
int Count()
Returns
GetDependentPlugins(Type, params IPlugin[]?)
Get a list of plugins that depend on the given type.
List<IPlugin> GetDependentPlugins(Type type, params IPlugin[]? additionalPlugins)
Parameters
Returns
GetManagedInfo()
Get a formatted string of all manageable objects that are managed by this manager.
string GetManagedInfo()
Returns
Has(string, bool, bool)
Check if the manager has a manageable object of the given type by its name.
bool Has(string typeName, bool checkAssignable = true, bool checkEnabled = true)
Parameters
Returns
Has(Type, bool, bool)
Check if the manager has a manageable object of the given type.
bool Has(Type type, bool checkAssignable = true, bool checkEnabled = true)
Parameters
Returns
Initialize(IPlugin)
Initialize the manager with the given plugin including its manageable objects.
void Initialize(IPlugin plugin)
Parameters
plugin
IPlugin
IsEnabled(IManageable?)
Check if the manageable object is enabled.
bool IsEnabled(IManageable? manageable)
Parameters
manageable
IManageable
Returns
Load(IPlugin)
Load the manager with the given plugin including its manageable objects. This should be called after all other Managers have been initialized.
void Load(IPlugin plugin)
Parameters
plugin
IPlugin
OnReload(IPlugin, ReloadReason)
Called when a reload is requested, can be used to perform custom actions before the reload and override the default reload behavior.
bool OnReload(IPlugin plugin, ReloadReason reason)
Parameters
plugin
IPluginreason
ReloadReason
Returns
- bool
true to allow default reload behaviour, false to stop
Ready(IPlugin)
Ready the manager with the given plugin including its manageable objects. This should be called after all other Managers have been loaded.
void Ready(IPlugin plugin)
Parameters
plugin
IPlugin
Reload(IPlugin, ReloadReason)
Reload the manager with the given plugin including its manageable objects. The manageable objects should be unloaded before calling their Reload method and should then be loaded after.
void Reload(IPlugin plugin, ReloadReason reason)
Parameters
plugin
IPluginreason
ReloadReason
RequiredType()
Type of the object that is required.
Type RequiredType()
Returns
- Type
Returns the type of the required manageable object.
RequiredTypeName()
Type name of the object that is required.
string RequiredTypeName()
Returns
- string
Returns the name of the required manageable object type.
Terminate(IPlugin)
Terminate the manager with the given plugin including its manageable objects. This should be called when the plugin is being unloaded or the manager is being disposed.
void Terminate(IPlugin plugin)
Parameters
plugin
IPlugin
TryInitialize(IManageable, IPlugin)
Try to initialize the manageable object with the given plugin.
bool TryInitialize(IManageable manageable, IPlugin plugin)
Parameters
manageable
IManageableplugin
IPlugin
Returns
TryLoad(IManageable, IPlugin)
Try to load the manageable object with the given plugin.
bool TryLoad(IManageable manageable, IPlugin plugin)
Parameters
manageable
IManageableplugin
IPlugin
Returns
TryReload(IManageable, IPlugin, ReloadReason)
Try to reload the manageable object with the given plugin.
bool TryReload(IManageable manageable, IPlugin plugin, ReloadReason reason)
Parameters
manageable
IManageableplugin
IPluginreason
ReloadReason
Returns
TryTerminate(IManageable, IPlugin)
Try to unload the manageable object with the given plugin.
bool TryTerminate(IManageable manageable, IPlugin plugin)
Parameters
manageable
IManageableplugin
IPlugin
Returns
TryUnload(IManageable, IPlugin)
Try to ready the manageable object with the given plugin.
bool TryUnload(IManageable manageable, IPlugin plugin)
Parameters
manageable
IManageableplugin
IPlugin
Returns
Unload(IPlugin)
Unload the manager with the given plugin including its manageable objects. This should be called before the manager is terminated.
void Unload(IPlugin plugin)
Parameters
plugin
IPlugin