Skip to content

EditOperation

Namespace: Hex1b.Documents

Assembly: Hex1b.dll

Base type for document edit operations. Sealed hierarchy for serialization.

csharp
[JsonDerivedType(typeof(InsertOperation), "insert")]
[JsonDerivedType(typeof(DeleteOperation), "delete")]
[JsonDerivedType(typeof(ReplaceOperation), "replace")]
public abstract record EditOperation : IEquatable<EditOperation>

Inheritance

ObjectEditOperation

Implements

Methods

Invert(string)

Returns the inverse operation that undoes this edit.

Parameters:

  • deletedText (String): The text that was removed by this operation (needed for inverse of delete/replace).

Returns: EditOperation

csharp
public abstract EditOperation Invert(string deletedText)

Released under the MIT License.