Show / Hide Table of Contents

# Interface IDisablablePlugin

Provides methods to allow runtime enabling and disabling of a plugin.

###### Namespace: IPA

###### Assembly: IPA.Loader.dll

##### Syntax

    public interface IDisablablePlugin

### Methods

| Improve this Doc View Source

#### OnDisable()

Called when a plugin is disabled at runtime. This should disable things like Harmony patches and unsubscribe from events. After this is called there should be no lingering effects of the mod.

##### Declaration

    void OnDisable()

##### Remarks

This will get called at shutdown, after OnApplicationQuit(), as well as when the plugin is disabled at runtime.

| Improve this Doc View Source

#### OnEnable()

Called when a plugin is enabled. This is where you should set up Harmony patches and the like.

##### Declaration

    void OnEnable()

##### Remarks

This will be called after Init, and will be called when the plugin loads normally too. When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.

Init will only ever be called once.

### Extension Methods

ReflectionUtil.SetPrivateField(Object, String, Object)
ReflectionUtil.GetPrivateField<T>(Object, String)
ReflectionUtil.SetPrivateProperty(Object, String, Object)
ReflectionUtil.InvokePrivateMethod(Object, String, Object[])
ReflectionUtil.InvokePrivateMethod<T>(Object, String, Object[])