Vixen
02b45cc4
csharp
public sealed class ListElementMember

One slot of a list, as a member so that the ordinary drawers can edit it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Not generated, because there is nothing in the source to generate it from. Every other InspectorMember describes something somebody declared and named; a list's third element is neither. So this is the one member type built at run time, and it is deliberately the boxed kind: IList's indexer already boxes, so a generic version would buy nothing and would need MakeGenericType — the one thing the descriptor layer exists to avoid.

The owner is the list, not the object that holds it. That is what lets ListDrawer hand each element row a field over a working copy and push the whole copy back through the outer member as one undoable edit.

Fields and properties (3)

  • public override Type MemberType

    What it holds.

  • public override Type OwnerType

    What it belongs to.

  • public override bool CanWrite

    Whether it can be written at all, condition and read-only flag aside.

Methods (4)

  • public ListElementMember(int index, Type elementType, InspectorMember template)

    Describes one slot.

  • public override object? GetBoxed(object owner)

    Reads it, boxing a value type.

  • public override void SetBoxed(object owner, object? value)

    Writes it, unboxing a value type.

  • public override IEditorCommand CreateSetCommand(IReadOnlyList<object> targets, object? value, EditorDocument? document)

Used by (1)

  • ListDrawerVixen.Editor.Inspector