Table of Contents

Class Editing

Namespace
Ofs
Assembly
Ofs.Api.dll

Registration of alternate edit modes. A mode owns how the user's editing gestures resolve — it can observe, drop, or replace each EditIntent. Registering only publishes the mode; the user activates it from the footer (there is no plugin-callable setter). Call RegisterMode(string, string, EditIntentHandler, Action?, Action?, Action<Ui>?) from OnLoad().

public sealed class Editing
Inheritance
object
Editing

Remarks

The onIntent callback runs on the main thread per gesture. It must return quickly.

Properties

StepTime

Seconds one action move-step travels under the active overlay (a frame interval, or a tempo beat) — the distance a left/right time nudge advances per rep. The host already applies it when delivering a single-action nudge as a MovePoint; a mode handling a multi-action MoveSelection multiplies it by direction × reps itself.

public double StepTime { get; }

Property Value

double

Methods

IsActive(string)

Whether the edit mode this plugin registered as id is the one the user has active in the footer. Use it to gate the plugin's editing UI (e.g. grey out settings until the user selects the mode). The host resolves id the same way RegisterMode(string, string, EditIntentHandler, Action?, Action?, Action<Ui>?) does — it prepends the plugin name — so pass the same local id.

public bool IsActive(string id)

Parameters

id string

Returns

bool

RegisterMode(string, string, EditIntentHandler, Action?, Action?, Action<Ui>?)

Publishes an edit mode the user can select in the footer. Call from OnLoad.

public void RegisterMode(string id, string displayName, EditIntentHandler onIntent, Action? onEnter = null, Action? onExit = null, Action<Ui>? onUi = null)

Parameters

id string

Local id (no namespace prefix); the host prepends the plugin name.

displayName string

Name shown in the footer's edit-mode selector (rendered verbatim).

onIntent EditIntentHandler

Resolves each edit gesture: Pass / Drop / Replace.

onEnter Action

Optional: runs when the user activates this mode.

onExit Action

Optional: runs when the user leaves this mode.

onUi Action<Ui>

Optional: draws this mode's options. The host calls it (with a Ui builder) only while this mode is the active one, in the docked Tool Options panel — so you no longer hand-gate the options on IsActive(string). Read/write your own backing fields in it, exactly as in OnRenderUi(Ui). Null = the mode contributes no options section.