Table of Contents

Interface IPluginStatusBoard

Namespace
AcDream.Plugin.Abstractions
Assembly
AcDream.Plugin.Abstractions.dll

A board of named status lines that plugins in one client share. Each plugin writes only under its own plugin id and every plugin can read what any plugin wrote, so one plugin can say what state it is in -- a mode, a phase, a target -- and another can show or report it without either referencing the other. Nothing here leaves the client, and the board starts empty each time the client loads its plugins; a login does not clear it.

public interface IPluginStatusBoard

Properties

IsAvailable

True when this host keeps a status board. The default implementation always reports false.

bool IsAvailable { get; }

Property Value

bool

Methods

Capture(string)

Every status line one plugin has published, keyed by name.

IReadOnlyDictionary<string, string> Capture(string pluginId)

Parameters

pluginId string

The publishing plugin's id, compared without regard to case.

Returns

IReadOnlyDictionary<string, string>

A copy of the plugin's lines; empty when it has none, when it is not loaded, or on a host without a board -- which is what the default implementation returns.

Publish(string, string?)

Sets one of the calling plugin's own status lines, or clears it.

bool Publish(string key, string? value)

Parameters

key string

The line's name, chosen by the plugin, compared exactly. 1 to 128 characters.

value string

The text, at most 4096 characters; null clears the line.

Returns

bool

False for a blank or over-long key, an over-long value, a 257th line for one plugin, or a host without a board -- which is what the default implementation does. Clearing a line that is not there is true.

Remarks

A plugin's lines are cleared when the plugin is unloaded, and a write after that is refused, so a line never outlives the plugin that wrote it.

TryRead(string, string, out string)

Reads one status line a plugin published.

bool TryRead(string pluginId, string key, out string value)

Parameters

pluginId string

The publishing plugin's id, as in its manifest, compared without regard to case.

key string

The line's name, compared exactly.

value string

The text; empty when this returns false.

Returns

bool

False when that plugin has no such line, when it is not loaded, or on a host without a board -- which is what the default implementation does.