Vixen
02b45cc4
csharp
public readonly record struct MemberPresentation

How a member should be presented, and what it will accept.

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

Remarks

⚠ default(MemberPresentation) is not the same thing as new MemberPresentation() would be in a class, and the difference bites exactly once per person. This is a struct, so both spellings give the all-zero value — which means IsEditorVisible comes out false despite the parameter above defaulting to true. A member handed a defaulted presentation is therefore hidden from the inspector, silently.

The generator never trips over it — it writes every field it means — and a hand-written descriptor should pass new MemberPresentation(IsEditorVisible: true) rather than relying on the parameter default. Said here rather than fixed by inverting the flag, because IsEditorHidden would read backwards everywhere it is used to spare one caller a surprise they only get once.

AllowsNull is the second flag with that shape and it is deliberately not a second surprise: it only means anything alongside an AssetType, and a descriptor stating one states the other in the same breath.

Fields and properties (11)

  • public string? Category

    Which group the inspector puts it in.

  • public string? DisplayName

    What the inspector calls it, or for its name.

  • public string? Tooltip

    What the inspector says about it.

  • public double? Minimum

    The low end of its range, if it has one.

  • public double? Maximum

    The high end of its range, if it has one.

  • public double Step

    How far one nudge moves it.

  • public bool Logarithmic

    Whether the slider should be logarithmic.

  • public bool IsEditorVisible

    Whether the inspector shows it at all.

  • public bool IsEditorReadOnly

    Whether the inspector shows it without letting it be changed.

  • public Type? AssetType

    What kind of asset it names, if it names one.

  • public bool AllowsNull

    Whether it may name nothing at all.

Methods (1)

  • public MemberPresentation(string? Category = null, string? DisplayName = null, string? Tooltip = null, double? Minimum = null, double? Maximum = null, double Step = 0, bool Logarithmic = false, bool IsEditorVisible = true, bool IsEditorReadOnly = false, Type? AssetType = null, bool AllowsNull = true)

    How a member should be presented, and what it will accept.

Used by (9)

  • MaterialHelloUi
  • MemberDescriptorVixen.Core.Reflection
  • NestedMemberTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • TypeRegistryTestsVixen.Core.Reflection.Tests
  • ReflectedDescriptorVixen.Editor.Inspector
  • ReflectedMemberVixen.Editor.Inspector
  • ReflectedTypesVixen.Editor.Scripts