Skip to content

IPluginServices

Interface in Oadm.Sdk.Plugins · Oadm.Sdk.dll

Services core plugins offer each other (ICorePluginContext.Services). The contract is an interface of the SDK: plugins load in assembly contexts of their own, so only SDK types are shared between them (e.g. IDeviceCertificateAuthority). An offer lives while the offering plugin runs: the host withdraws it when the plugin stops or its package is turned off. Thread-safe.

public interface IPluginServices
T? Find<T>() where T : class

The offer of T by a running plugin; null when none. Ask again each time, never keep it.

void Offer<T>(T service) where T : class

Offers service as T (usually from ICorePlugin.StartAsync); replaces this plugin’s earlier offer of the same type. Throws InvalidOperationException when another running plugin already offers T.

void Withdraw<T>() where T : class

Withdraws this plugin’s offer of T; nothing happens without one.