Vixen
02b45cc4
csharp
public sealed class InspectorView

The inspector: editors generated from what a type's attributes say about it.

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

Remarks

Everything it draws came from a generator. The member list, the attribute metadata and the accessors are compile-time facts registered by module initializers — no reflection pass, no assembly scan, and a member that could not be described was a build warning rather than a row that quietly never appears.

Several targets at once, which is what an inspector is for. Selecting twenty objects and setting one field on all of them is the operation; showing the first one's values and silently editing only that is the bug. Where the targets disagree the editors say so, and typing into one writes to every one of them — Read and Write are where that lives, so a third-party drawer gets it for free.

Every edit is an IEditorCommand on the document's stack, produced by the field rather than by the drawer, so undo works without per-drawer effort and a drawer that wrote a member directly is a visible mistake rather than an invisible one.

Fields and properties (18)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public DrawerRegistry Drawers

    Which drawer edits which member.

  • public PropertyClipboard Clipboard

    Where copy-property puts things.

  • public EditorDocument? EditedDocument

    Where edits are recorded.

  • public IEditorRegistry Extensions

    Where the panel looks for a hand-written inspector to use instead of the rows.

  • public EditTarget? Edited

    What is being edited, as the pipeline sees it, or for nothing.

  • public IPrefabSource? Prefab

    What the inspected objects were made from, for override marks and revert.

  • public UiElement Header

    The strip above the rows: the search box and the lock.

  • public SearchBox Search

    The search box above the rows.

  • public ToggleButton Lock

    Holds the inspector on what it is showing while the selection moves on.

  • public ScrollView Scroll

    The region the rows scroll in.

  • public UiElement Body

    Where the rows go.

  • public EmptyState Empty

    Shown instead of the rows when the selection has nothing in common.

  • public IReadOnlyList<object> Targets

    What is being inspected.

  • public IReadOnlyList<InspectorRow> Rows

    The rows, in order.

  • public InspectorDescriptor? Descriptor

    The type every target has in common, if they have one.

  • public bool IsLocked

    Whether the inspector is held on what it is showing.

Events (2)

Methods (9)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public void Inspect(params ReadOnlySpan<object> objects)

    Shows the members of some objects.

  • public void Clear()

    Shows nothing.

  • public void Reload()

    Reads every editor back from the objects, without rebuilding anything.

  • public bool Copy(InspectorRow row)

    Copies a row's value.

  • public bool Paste(InspectorRow row)

    Pastes into a row.

  • public bool Reset(InspectorRow row)

    Puts a row back to its type's default.

  • public bool RevertToPrefab(InspectorRow row)

    Puts a row back to the prefab's value.

  • public ContextMenu Contextualise()

    Puts a Copy / Paste / Reset / Revert menu on the rows.

Used by (17)

  • AddressableGroupsViewVixen.Editor.AssetEditors
  • DeclaredContributionTestsVixen.Editor.App.Tests
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • EditorSessionVixen.Editor.Testing
  • ImportSettingsViewVixen.Editor.AssetEditors
  • InspectorFixtureVixen.Editor.Inspector.Tests
  • InspectorPanelTestsVixen.Editor.App.Tests
  • MaterialViewVixen.Editor.AssetEditors
  • OneEditPathTestsVixen.Editor.App.Tests
  • OutOfTreePluginTestsVixen.Editor.App.Tests
  • PanelTestsVixen.Editor.Inspector.Tests
  • ScenarioTestsVixen.Editor.App.Tests
  • SelectionTestsVixen.Editor.App.Tests
  • TerrainModuleVixen.Editor.Terrain
  • TextureImportViewVixen.Editor.AssetEditors
  • ThemeTestsVixen.Editor.Inspector.Tests