Vixen
02b45cc4
csharp
public sealed class EditorShell

The editor's window: a menu bar, a toolbar, a docking workspace and a status bar.

Read the guide page for this →

Remarks

Everything in this assembly, wired together once. The pieces are usable on their own — a registry with no shell, a workspace with no palette — and this is the arrangement the editor uses, so that Vixen.Editor.App is a window, a device and a frame loop rather than three hundred lines of assembly.

⚠ No platform, no device, no window. A shell is a UiDocument and nothing else — the same bargain Samples/02-HelloUi's shell makes, and the reason the whole of the editor's chrome is testable headless: doc 11's "headless editor host driving synthetic input against the real element tree" needs this class to be constructible without a GPU, and it is.

⚠ It registers the view commands and no others. Save, Undo and Open belong to something that has a project; the shell's default menu model names them anyway and the menu builder skips what nothing has registered — so an application that registers file.save gets it in the File menu, in the palette and on its shortcut without telling the shell anything.

Fields and properties (30)

  • public KeyBindingsView? Keyboard

    The keybinding editor, while its panel is open.

  • public MessageLogView? Messages

    The message log, while its panel is open.

  • public const string KeyBindingsPanel

    What the keybinding editor's panel is called in an arrangement.

  • public const string MessageLogPanel

    And the message log's.

  • public UiDocument Document

    The document the host lays out, draws and dispatches into.

  • public CommandRegistry Commands

    Everything the editor can be asked to do.

  • public KeyMap Keys

    What runs it from the keyboard.

  • public CommandDispatcher Dispatcher

    What listens for the chords.

  • public DockingWorkspace Workspace

    The panels, the arrangement, and the presets.

  • public MenuModel Menus

    What is on the menu bar.

  • public MenuGroup Window

    The Window menu, which is where a panel or a layout adds itself.

  • public MenuGroup View
  • public MenuPresenter MenuBar

    The menu bar itself.

  • public ToolbarPresenter ModeBar

    The strip under it: which mode the viewport's input is in, and that mode's tools.

  • public EditorModes Modes

    What the viewport's input means right now, and what else it could mean.

  • public ToolbarPresenter Toolbar

    The strip under it.

  • public UiElement StatusBar

    The strip along the bottom.

  • public ToastHost Toasts

    Where messages appear.

  • public NotificationCenter Notifications

    What the editor has told the user.

  • public BackgroundTaskManager Tasks

    What it is doing in the background.

  • public ThemeService Theme

    Light or dark, and the user's own tokens over it.

  • public CommandPalette Palette

    Fuzzy search over everything.

  • public CommandPalette Search

    Fuzzy search over everything the editor has: assets, entities, settings.

  • public DialogService Dialogs

    How the editor asks a question.

  • public Func<IEnumerable<string>>? Recent

    What File ▸ Open Recent lists, asked every time the menu is built.

  • public string Title

    What the window's title bar should say.

  • public string? Status

    What the status bar says on the left.

  • public string? Context

    Which context the user is in, which decides what a scoped command means.

  • public Func<int>? SelectionCount

    How many things are selected, for the status bar to report.

  • public double FrameTime

    The mean time one editor frame has taken lately, in milliseconds.

Events (3)

  • public Action<KeyBindingsView>? KeyboardBuilt

    Raised when the keybinding panel is built, so a host can wire what it cannot.

  • public Action<string>? TitleChanged

    Raised when Title changes.

  • public Action<string?>? ContextChanged

    Raised when Context changes.

Methods (13)

  • public EditorShell(float width, float height, ThemeMode mode = Dark)

    Builds the shell into a new document.

  • public void RefreshShortcutFormat()

    Decides again how a shortcut is written, now that there is a font to judge with.

  • public void Describe(string? document, bool dirty, string? project)

    Says what this window is looking at.

  • public PanelDescriptor RegisterPanel(PanelDescriptor descriptor)

    Declares a panel and the command that shows it.

  • public PanelDescriptor RegisterPanel(string id, StringId title, Action<DockPanel> build)

    Declares a panel and the command that shows it.

  • public bool UnregisterPanel(string id)

    Takes a panel and its command back out.

  • public void RegisterLayout(string name, StringId title, Func<DockLayout> layout)

    Declares a named arrangement and the command that applies it.

  • public bool UnregisterLayout(string name)

    Takes a named arrangement and its command back out.

  • public static string PanelCommand(string panelId)

    What the command that shows a panel is called.

  • public static string LayoutCommand(string layoutName)

    What the command that applies a layout is called.

  • public void Tick(TimeSpan now, TimeSpan delta)

    Advances whatever moves by itself, and applies what the background has reported.

  • public void Resize(float width, float height)

    Changes the surface's size.

  • public void Dispose()

Used by (64, showing 40)

  • AssetPickerTestsVixen.Editor.App.Tests
  • BlockoutModeVixen.Editor.Blockout
  • BlockoutModeTestsVixen.Editor.Blockout.Tests
  • BlockoutSelectionTestsVixen.Editor.Blockout.Tests
  • BuildSettingsTestsVixen.Editor.App.Tests
  • ChromeFixtureVixen.Editor.Ui.Tests
  • ClosingTestsVixen.Editor.App.Tests
  • ConsolePanelTestsVixen.Editor.App.Tests
  • ContentTasksVixen.Editor.App
  • CreateMenuTestsVixen.Editor.App.Tests
  • DeclaredContributionTestsVixen.Editor.App.Tests
  • DeclaredContributionsVixen.Editor.App
  • DiagnosticsModuleVixen.Editor.Diagnostics
  • DiagnosticsPanelTestsVixen.Editor.App.Tests
  • DropIntoFieldTestsVixen.Editor.App.Tests
  • DropIntoSceneTestsVixen.Editor.App.Tests
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • EditorChromeVisualTestsVixen.Editor.Ui.Tests
  • EditorHostVixen.Editor.Host
  • EditorModeTestsVixen.Editor.App.Tests
  • EditorModesVixen.Editor.Ui
  • EditorScriptTestsVixen.Editor.Scripts.Tests
  • EditorSessionVixen.Editor.Testing
  • EditorShellTestsVixen.Editor.Ui.Tests
  • FakeVixen.Editor.Ui.Tests
  • FoliageModeVixen.Editor.Terrain
  • FoliageModeTestsVixen.Editor.Terrain.Tests
  • HarnessTestsVixen.Editor.App.Tests
  • IEditorModeVixen.Editor.Ui
  • KeyBindingsPanelTestsVixen.Editor.App.Tests
  • LoadingTestsVixen.Editor.Plugin.Tests
  • MenuBarTestsVixen.Editor.App.Tests
  • MilestoneE3TestsVixen.Editor.App.Tests
  • MilestoneE5TestsVixen.Editor.App.Tests
  • ModeVixen.Editor.App.Tests
  • ModeStripTestsVixen.Editor.Ui.Tests
  • ModeTestsVixen.Editor.Ui.Tests
  • ModuleTestsVixen.Editor.Plugin.Tests
  • OutOfTreePluginTestsVixen.Editor.App.Tests