Plugins

References
public sealed class Plugins
Immutable collection of plugin data.

Properties

Empty

#
public static Plugins Empty { get; }
Create a new, empty Plugins instance.

FailedCount

#
public int FailedCount { get; }
Gets the number of failed plugins.

FailedLocations

#
public IEnumerable<string> FailedLocations { get; }
Enumerate over the failed locations.

Failures

#
public IEnumerable<(string location, FailureInfo info)> Failures { get; }
Enumerate over the failed data pairs.

Loaded

#
public IEnumerable<(string location, Plugin plugin, Assembly assembly)> Loaded { get; }
Enumerate over the loaded data triplets.

LoadedAssemblies

#
public IEnumerable<Assembly> LoadedAssemblies { get; }
Enumerate over the loaded plugin assemblies.

LoadedCount

#
public int LoadedCount { get; }
Gets the number of loaded plugins.

LoadedLocations

#
public IEnumerable<string> LoadedLocations { get; }
Enumerate over the loaded locations.

LoadedPlugins

#
public IEnumerable<Plugin> LoadedPlugins { get; }
Enumerate over the loaded plugin instances.

LoadingProgress

#
public float LoadingProgress { get; }
Gets the progress factor (0.0 to 1.0). This is the ratio of all loaded+failed plugins to all known plugins.

ScopedCount

#
public int ScopedCount { get; }
Gets the number of scoped locations.

ScopedLocations

#
public IEnumerable<string> ScopedLocations { get; }
Enumerate over the scoped locations.

Methods

AddFailedLocation

#
public Plugins AddFailedLocation(string location, FailureInfo info)
Add a failed location to this Plugins instance. The location must currently already be part of the Scoped list.
location (string)Location to add to failed list.
info (FailureInfo)Reason for load failure.

AddLoadedPlugin

#
public Plugins AddLoadedPlugin(string location, Plugin plugin, Assembly assembly)
Add a loaded plugin to this Plugins instance. The location must currently already be part of the Scoped list and may not be part of the failed list.
location (string)Location to add to failed list.
plugin (Plugin)Plugin instance.
assembly (Assembly)Plugin assembly.

AddScopedLocation

#
public Plugins AddScopedLocation(string location)
Add a scoped location to this Plugins instance.
location (string)Location to add to scoped list.

FindFailureInfo

#
public FailureInfo FindFailureInfo(string location)
Find the failure info (if any) associated with the given plugin location.
location (string)

FindPlugin

#
public Plugin FindPlugin(string location)
Find the loaded plugin (if any) associated with the given location.
location (string)

ForgetScopedLocation

#
public Plugins ForgetScopedLocation(string location)
Remove a location from the scoped list.
location (string)

IsLocationFailed

#
public bool IsLocationFailed(string location)
Test whether a specific uri has already failed to load and is now part of the failed list.
location (string)Location to test.
True if location has already failed.

IsLocationKnown

#
public bool IsLocationKnown(string location)
Test whether a specific uri is known at all.
location (string)Location to test.
True if location is either scoped, loaded or failed.

IsLocationLoaded

#
public bool IsLocationLoaded(string location)
Test whether a specific uri is already part of the Loaded Locations list.
location (string)Location to test.
True if location is already loaded.

IsLocationScoped

#
public bool IsLocationScoped(string location)
Test whether a specific uri is already part of the Scoped Locations list.
location (string)Location to test.
True if location is already scoped.

RemoveLocation

#
public Plugins RemoveLocation(string location)
Remove a location from either the loaded or the failed lists.
location (string)Location to remove.