Table of Contents

Struct EditResult

Namespace
Ofs
Assembly
Ofs.Api.dll

What an edit mode decides for an intent: apply it unchanged, drop it, or replace it with other intents.

public readonly struct EditResult

Properties

Drop

Discard the intent; nothing is applied.

public static EditResult Drop { get; }

Property Value

EditResult

Pass

Apply the intent unchanged (native behavior).

public static EditResult Pass { get; }

Property Value

EditResult

Methods

Replace(params EditIntent[])

Discard the original; apply the given intents instead (none ≡ Drop). The intents are projected across the active edit group below the seam — a lead-axis mutation fans to followers as a mechanical offset (the common case: drags, nudges).

public static EditResult Replace(params EditIntent[] intents)

Parameters

intents EditIntent[]

Returns

EditResult

Examples

Turn one click into three points on the gestured axis (one undo step):

<pre><code class="lang-csharp">EditIntentKind.AddPoint => EditResult.Replace(
EditIntent.AddPoint(intent.Axis, intent.Time, 10),
EditIntent.AddPoint(intent.Axis, intent.Time + 1.0, 20),
EditIntent.AddPoint(intent.Axis, intent.Time + 2.0, 30)),</code></pre>

Remarks

You may emit several intents — including several for the same axis. The host applies them in the order given, each against the state the previous one left (no dedup or merge), and coalesces the whole batch into a single undo step. Because each intent sees the prior one's result, chain by the moved-to coordinate: a MovePoint(from: 2.0, …) after an intent that moved an action to 2.0 retargets that just-moved action.

Replace(IEnumerable<EditIntent>)

Discard the original; apply the given intents instead.

public static EditResult Replace(IEnumerable<EditIntent> intents)

Parameters

intents IEnumerable<EditIntent>

Returns

EditResult

ReplacePerAxis(params EditIntent[])

Like Replace(params EditIntent[]), but the host applies these intents to the lead axis alone and then re-consults this mode once per other editable axis (the request retargeted to that axis), applying each result verbatim — no projection. Use it when "the same gesture" means something computed from each axis's own data (e.g. snap to per-axis grids). The per-axis re-consultations are leaves: a ReplacePerAxis(params EditIntent[]) returned from one degrades to a plain Replace(params EditIntent[]) (one level deep). For a gesture that edits an existing action in place (a move or a remove), a follower axis that has no action at the lead's source time is dropped, not re-consulted — its actions don't line up with the lead, so the retargeted intent would name nothing on it (the same axis the host skips in native projection).

public static EditResult ReplacePerAxis(params EditIntent[] intents)

Parameters

intents EditIntent[]

Returns

EditResult

ReplacePerAxis(IEnumerable<EditIntent>)

Per-axis replacement (see ReplacePerAxis(params EditIntent[])).

public static EditResult ReplacePerAxis(IEnumerable<EditIntent> intents)

Parameters

intents IEnumerable<EditIntent>

Returns

EditResult