Table of Contents

Class PluginFeature

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents an feature of a certain type provided by a plugin

public abstract class PluginFeature : CorePropertyChanged, IDisposable
Inheritance
PluginFeature
Implements
Derived

Properties

Id

Gets the identifier of this plugin feature

public string Id { get; }

Property Value

string

Info

Gets the plugin feature info related to this feature

public PluginFeatureInfo Info { get; }

Property Value

PluginFeatureInfo

IsEnabled

Gets whether the plugin is enabled

public bool IsEnabled { get; }

Property Value

bool

Plugin

Gets the plugin that provides this feature

public Plugin Plugin { get; }

Property Value

Plugin

Profiler

Gets the profiler that can be used to take profiling measurements

public Profiler Profiler { get; }

Property Value

Profiler

Methods

AddTimedUpdate(TimeSpan, Action<double>, string?)

Registers a timed update that whenever the plugin is enabled calls the provided action at the provided interval

public TimedUpdateRegistration AddTimedUpdate(TimeSpan interval, Action<double> action, string? name = null)

Parameters

interval TimeSpan

The interval at which the update should occur

action Action<double>

The action to call every time the interval has passed. The delta time parameter represents the time passed since the last update in seconds

name string

An optional name used in exceptions and profiling

Returns

TimedUpdateRegistration

The resulting plugin update registration which can be used to stop the update

AddTimedUpdate(TimeSpan, Func<double, Task>, string?)

Registers a timed update that whenever the plugin is enabled calls the provided asyncAction at the provided interval

public TimedUpdateRegistration AddTimedUpdate(TimeSpan interval, Func<double, Task> asyncAction, string? name = null)

Parameters

interval TimeSpan

The interval at which the update should occur

asyncAction Func<double, Task>

The async action to call every time the interval has passed. The delta time parameter represents the time passed since the last update in seconds

name string

An optional name used in exceptions and profiling

Returns

TimedUpdateRegistration

The resulting plugin update registration

Disable()

Called when the feature is deactivated or when Artemis shuts down

public abstract void Disable()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the plugin feature and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Enable()

Called when the feature is activated

public abstract void Enable()

OnDisabled()

Triggers the Disabled event

protected virtual void OnDisabled()

OnEnabled()

Triggers the Enabled event

protected virtual void OnEnabled()

Events

Disabled

Occurs when the feature is disabled

public event EventHandler? Disabled

Event Type

EventHandler

Enabled

Occurs when the feature is enabled

public event EventHandler? Enabled

Event Type

EventHandler