Vixen
02b45cc4
csharp
public class EditTarget

What is being edited: some objects, where their edits are recorded, and how to reach their members.

Read the guide page for this →

Remarks

Doc 36 § D1's single source of truth, and the thing markup binds against. A panel is handed one of these and asks it for properties by name; it does not know whether the objects are entities, graph nodes, an asset or a settings file, and it does not know how many of them there are. That is what makes one panel work for a selection of one and a selection of twenty, and what will let a .vxml attribute name a member without the markup knowing any C# type.

⚠ One type, not a common base. CommonType is null unless every object is exactly the same type. Falling back to whatever a light and a camera both derive from would produce a different set of editors depending on what else happened to be selected; a mixed selection having nothing to edit is honest, and is what every editor that tried the alternative ended up doing.

The objects are held, not copied. A selection that changes is a new EditTarget, because a target whose contents shifted underneath it would make an in-flight drag write to something the user did not aim at.

Fields and properties (6)

  • public IReadOnlyList<object> Objects

    What is being edited, in selection order.

  • public EditorDocument? Document

    Where the edits are recorded, or for a preview nobody is editing.

  • public IEditProvider Provider

    How the members are reached.

  • public Type? CommonType

    The type every object is, or when they are not all one.

  • public bool IsEmpty

    Whether there is anything here to edit.

  • public IReadOnlyList<IEditMember> Members

    The members every object has, in the order they should be shown.

Methods (7)

  • public EditTarget(IReadOnlyList<object> objects, IEditProvider? provider = null, EditorDocument? document = null)

    Binds a selection to a provider.

  • public bool TryFind(string path, out EditProperty? property)

    Binds one member by name.

  • protected virtual EditProperty Create(IEditMember member)

    Makes the binding for one member.

  • public EditProperty? Find(string path)

    Binds one member by name, or nothing.

  • public IReadOnlyList<EditProperty> Properties()

    Binds every member.

  • public CommandTransaction? Begin(string name)

    Collects everything written until it closes into one undo entry.

  • public void Seal()

    Ends the run of edits that were collapsing into one undo entry.

Used by (8)

  • CustomInspectorVixen.Editor.Inspector
  • DeclaredContributionsVixen.Editor.App
  • EditPipelineTestsVixen.Editor.Core.Tests
  • InspectorTargetVixen.Editor.Inspector
  • InspectorViewVixen.Editor.Inspector
  • MarkupBindingVixen.Editor.Inspector
  • MarkupInspectorVixen.Editor.Inspector
  • PropertyFieldVixen.Editor.Inspector