Skip to content

Class PluginExtensions

Namespace: Void.Proxy.Api.Plugins.Extensions
Assembly: Void.Proxy.Api.dll

Provides assembly-based plugin lookup operations.

public static class PluginExtensions

Inheritance

objectPluginExtensions

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

GetPluginFromType<T>(IPluginService)

Gets the loaded plugin defined in the same assembly as T.

public static IPlugin GetPluginFromType<T>(this IPluginService plugins)

Parameters

plugins IPluginService

The plugin service to search.

Returns

IPlugin

The plugin whose implementation assembly contains T.

Type Parameters

T

A type from the target plugin assembly.

Exceptions

InvalidOperationException

No loaded plugin is defined in the assembly containing T.

GetPluginFromType(IPluginService, Type)

Gets the loaded plugin defined in the same assembly as a runtime type.

public static IPlugin GetPluginFromType(this IPluginService plugins, Type type)

Parameters

plugins IPluginService

The plugin service to search.

type Type

A type from the target plugin assembly.

Returns

IPlugin

The plugin whose implementation assembly contains type.

Exceptions

InvalidOperationException

No loaded plugin is defined in the assembly containing type.

TryGetPluginFromType(IPluginService, Type, out IPlugin)

Attempts to find the loaded plugin defined in the same assembly as a runtime type.

public static bool TryGetPluginFromType(this IPluginService plugins, Type type, out IPlugin plugin)

Parameters

plugins IPluginService

The plugin service to search.

type Type

A type from the target plugin assembly.

plugin IPlugin

When this method returns true, the first matching loaded plugin; otherwise, null.

Returns

bool

true when a matching plugin is loaded; otherwise, false.