public sealed class ConsoleViewThe panel that is looked at most often when something has gone wrong.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Doc 20 calls the Console "the least built thing in the shell" and the largest single item in its Part A, and both were true: it was a TextBlock saying "Nothing logged yet." What replaces it is doc 20's A7 in full — a virtualised list over the ring the diagnostics layer already keeps, level toggles carrying counts, a category filter, a search box, collapse-duplicates, clear, clear-on-play, and a detail pane showing the whole record and its stack.
⚠ It does not allocate per line. Doc 20 is blunt about why — "a game logging per frame into a panel that keeps strings is a leak with a UI" — and there are two halves to it. ConsoleModel pulls only what is new out of the ring and keeps indices rather than text; VirtualizingPanel keeps about thirty row elements whatever the list holds. A hundred thousand lines is a hundred thousand records the sink had already allocated, and thirty elements.
⚠ Rows are rebuilt from the model on Tick, not from an event. The sink is written from every thread the editor runs work on — a content import logs from the pool — so a subscription would rebuild the panel from a background thread. One pull per frame on the thread that owns the document is the same bargain ContentTasks makes.
⚠ Selecting a row is not the same as it staying selected. The list scrolls as records arrive, and the detail pane is holding a record rather than a row index — so a line selected and then pushed off the top by a burst still has its stack on screen.
Fields and properties (10)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public ConsoleModel? ModelWhat it is showing.
public UiElement ToolbarThe strip along the top.
public VirtualizingPanel ListThe list itself.
public UiElement DetailThe pane under it showing the whole of the selected record.
public SearchBox SearchThe search box.
public Select CategoriesThe category picker.
public bool ClearsOnPlayWhether the console throws itself away when play mode is entered.
public LogRecord? SelectedWhich record the detail pane is showing, or .
Events (1)
public Action<ConsoleView, LogRecord>? ActivatedRaised when a row is activated, for a host that can open a source file.
Methods (5)
public void Show(ConsoleModel model)Points the console at a sink's records.
public void Tick(TimeSpan now = default(TimeSpan))Takes whatever has been logged and brings the rows up to date.
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
protected override void OnRemoved()Called once, as the element leaves the document.
public void Clear()Empties the console, which empties the ring behind it.
Used by (4)
- ChromeFixtureVixen.Editor.Ui.Tests
- ConsolePanelTestsVixen.Editor.App.Tests
- ConsoleViewTestsVixen.Editor.Ui.Tests
- EditorApplicationVixen.Editor.App