Vixen
02b45cc4
csharp
public sealed class MemberDescriptor

One member of a described type, and the two delegates that read and write it.

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

Remarks

The accessors are generated lambdas — static instance => ((Foo)instance).X — not PropertyInfo calls. That is the entire point of this assembly: an inspector, a serializer fallback and a diff tool can all read and write arbitrary members on a platform where System.Reflection's member access has been trimmed away.

They pass values as Object, which boxes a struct. That is deliberate and it is why this is not a frame-loop API: it exists for tooling, inspection and boot-time discovery, where one allocation per property read is invisible. Frame code uses the generated serializer or touches the field directly.

Fields and properties (7)

  • public string Name

    The member's name in source.

  • public Type MemberType

    What it holds.

  • public int Order

    Where it sits in the type's declared order.

  • public MemberPresentation Presentation

    How it should be presented.

  • public bool CanWrite

    Whether it can be written at all.

  • public bool IsInitOnly

    Whether it is init-only — settable, but only meant to be set once.

  • public bool IsSerialized

    Whether the member is part of the type's data, or only of its API.

Methods (4)

  • public MemberDescriptor(string name, Type memberType, int order, Func<object, object?>? getter, Action<object, object?>? setter, MemberPresentation presentation = default(MemberPresentation), bool isInitOnly = false, bool isSerialized = true)

    Describes a member.

  • public object? GetValue(object instance)

    Reads the member.

  • public void SetValue(object instance, object? value)

    Writes the member.

  • public override string ToString()

    Renders the member as Name : Type.

Used by (14)

  • MaterialHelloUi
  • NestedMemberTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyRowVixen.Ui.Controls.Advanced
  • SplineAssetTestsVixen.Core.Mathematics.Tests
  • TypeDescriptorVixen.Core.Reflection
  • TypeRegistryTestsVixen.Core.Reflection.Tests
  • YamlSerializerVixen.Core.Yaml
  • EditorScriptTestsVixen.Editor.Scripts.Tests
  • ReflectedDescriptorVixen.Editor.Inspector
  • ReflectedMemberVixen.Editor.Inspector
  • ReflectedTypeTestsVixen.Editor.Scripts.Tests
  • ReflectedTypesVixen.Editor.Scripts