Repository navigation
Plugin API Reference
This page summarizes the public host surface available through IPluginContext.
public interface ISimulcastPlugin
{
IPluginInfo Info { get; }
Task InitializeAsync(IPluginContext pluginContext, CancellationToken cancellationToken = default);
Task EnableAsync(CancellationToken cancellationToken = default);
Task DisableAsync(CancellationToken cancellationToken = default);
Task HandleApplicationArgumentsAsync(IReadOnlyList<string> arguments, CancellationToken cancellationToken = default);
}| Property | Guidance |
|---|---|
PluginIdentifier |
Generate once, keep forever, and never use Guid.Empty
|
Name |
Short user-facing product name |
Description |
One or two useful sentences shown in Manage Plugins |
Version |
Plugin version, independent from application version |
Author |
Person or organization maintaining the plugin |
Changing the identifier makes the host treat the assembly as a different plugin and changes its data-store folder.
public interface IPluginContext
{
string InstallationDirectory { get; }
IReceiverRepository ReceiverRepository { get; }
IReceiverManager ReceiverManager { get; }
IReceiverCommandManager ReceiverCommandManager { get; }
IPluginApplicationDispatcher ApplicationDispatcher { get; }
IPluginThemeManager ThemeManager { get; }
IPluginUiManager UiManager { get; }
IPluginDataStore DataStore { get; }
ILogger Logger { get; }
}InstallationDirectory is the plugin folder, not the application installation folder. Use it to resolve plugin-owned images, native libraries, or templates that were distributed beside the DLL.
await context.ApplicationDispatcher.DispatchAsync(
new PluginApplicationCommand("manage-receivers", new Dictionary<string, string?>()),
cancellationToken);Supported commands:
| Name | Arguments | Result |
|---|---|---|
show-main |
None | Shows and activates the main receiver page |
manage-receivers |
None | Opens Manage Receivers |
add-receiver |
None | Opens Manage Receivers in add mode |
select-receiver |
receiverId: application Guid
|
Selects the receiver and returns to the main page |
Unknown command names are ignored. These commands are application navigation requests, not receiver protocol commands.
T? ReadAsync<T>(string name, CancellationToken cancellationToken = default);
Task WriteAsync<T>(string name, T value, CancellationToken cancellationToken = default);
Task DeleteAsync(string name, CancellationToken cancellationToken = default);
bool Exists(string name);Names are logical keys. Do not include paths or extensions. See Plugin Settings and Data.
Task InvokeOnMainWindowAsync(Guid pluginIdentifier, Action<Window> action, CancellationToken cancellationToken = default);
Task<TElement?> FindElementAsync<TElement>(Guid pluginIdentifier, string elementName, CancellationToken cancellationToken = default);
void RegisterCleanup(Guid pluginIdentifier, Action cleanupAction);
Task ShowNotificationAsync(Guid pluginIdentifier, PluginNotificationRequest notification, CancellationToken cancellationToken = default);
Task<bool> ShowConfirmationAsync(Guid pluginIdentifier, string title, string message, CancellationToken cancellationToken = default);
Task ShowDialogAsync(Guid pluginIdentifier, PluginDialogRequest dialog, CancellationToken cancellationToken = default);
Task RemovePluginUiAsync(Guid pluginIdentifier, CancellationToken cancellationToken = default);All UI operations are marshalled to the application dispatcher by the host. ShowDialogAsync currently shows an owned, modeless plugin window; it does not block the main application.
Task ApplyResourceDictionaryAsync(Guid pluginIdentifier, Uri resourceDictionaryUri, CancellationToken cancellationToken = default);
Task RemoveResourceDictionaryAsync(Guid pluginIdentifier, CancellationToken cancellationToken = default);
Task SetWindowChromeModeAsync(Guid pluginIdentifier, PluginWindowChromeMode mode, CancellationToken cancellationToken = default);Use PluginWindowChromeMode.Light for light themes and Dark for dark themes.
new PluginNotificationRequest("Title", "Message", PluginNotificationSeverity.Information);
new PluginDialogRequest("Title", contentElement, Width: 720, Height: 520);Notification severities are Information, Success, and Error.