Table of Contents

Class PluginConfiguration

Namespace
SharpConsoleUI.Configuration
Assembly
SharpConsoleUI.dll

Configuration options for the plugin system in ConsoleWindowSystem.

public record PluginConfiguration : IEquatable<PluginConfiguration>
Inheritance
PluginConfiguration
Implements
Inherited Members

Constructors

PluginConfiguration(bool, string?, bool, bool, string?)

Configuration options for the plugin system in ConsoleWindowSystem.

public PluginConfiguration(bool AutoLoad = false, string? PluginsDirectory = null, bool SearchSubdirectories = true, bool FailOnLoadError = false, string? LoadOnlyPluginPattern = null)

Parameters

AutoLoad bool

Whether to automatically load plugins from the plugins directory on startup. Defaults to false for security and performance reasons.

PluginsDirectory string

Path to the directory containing plugin DLLs. Can be absolute or relative to the application's base directory. If null, uses the default "plugins" directory.

SearchSubdirectories bool

Whether to search subdirectories when auto-loading plugins. Defaults to true to support organized plugin structures.

FailOnLoadError bool

Whether to throw an exception if a plugin fails to load during auto-load. If false, failed plugins are logged and skipped. Defaults to false for resilience.

LoadOnlyPluginPattern string

Optional file pattern to filter which DLLs are loaded (e.g., "*.Plugin.dll"). If null, all DLLs in the plugins directory are scanned. Defaults to null.

Properties

AutoLoad

Whether to automatically load plugins from the plugins directory on startup. Defaults to false for security and performance reasons.

public bool AutoLoad { get; init; }

Property Value

bool

AutoLoadDefault

Configuration with auto-loading enabled from the default "plugins" directory.

public static PluginConfiguration AutoLoadDefault { get; }

Property Value

PluginConfiguration

AutoLoadStrict

Configuration for auto-loading with strict error handling (throws on load failure).

public static PluginConfiguration AutoLoadStrict { get; }

Property Value

PluginConfiguration

Default

Default configuration with auto-loading disabled (safest option).

public static PluginConfiguration Default { get; }

Property Value

PluginConfiguration

FailOnLoadError

Whether to throw an exception if a plugin fails to load during auto-load. If false, failed plugins are logged and skipped. Defaults to false for resilience.

public bool FailOnLoadError { get; init; }

Property Value

bool

LoadOnlyPluginPattern

Optional file pattern to filter which DLLs are loaded (e.g., "*.Plugin.dll"). If null, all DLLs in the plugins directory are scanned. Defaults to null.

public string? LoadOnlyPluginPattern { get; init; }

Property Value

string

PluginsDirectory

Path to the directory containing plugin DLLs. Can be absolute or relative to the application's base directory. If null, uses the default "plugins" directory.

public string? PluginsDirectory { get; init; }

Property Value

string

SearchSubdirectories

Whether to search subdirectories when auto-loading plugins. Defaults to true to support organized plugin structures.

public bool SearchSubdirectories { get; init; }

Property Value

bool

Methods

AutoLoadFrom(string)

Configuration for auto-loading from a custom directory.

public static PluginConfiguration AutoLoadFrom(string pluginsDirectory)

Parameters

pluginsDirectory string

Custom plugins directory path

Returns

PluginConfiguration

Configuration with auto-loading enabled

GetEffectivePluginsDirectory()

Gets the effective plugins directory path, resolving relative paths and using the default "plugins" directory if not specified.

public string GetEffectivePluginsDirectory()

Returns

string

Absolute path to the plugins directory