public sealed class NotificationCenterWhat the editor has told the user, and the corner it told them in.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A toast plus a history, because a toast on its own is a message nobody can go back to. The thing a user does after an import fails is look away, look back, and find the message gone — so every toast is also an entry in a list the notification panel shows.
⚠ An error stays longer and still goes away. It used to be MaxValue, on the argument that an error which disappears while somebody is reading the line number is an error they have to reproduce — and what that produced in practice was a corner of the window filled with red rectangles from an import pass an hour ago, each needing a click, over the viewport. The message is in the console and in History either way, which is where somebody goes back to it; the toast's job is to be noticed. So an error gets ErrorDuration — long enough to read a sentence, and not forever.
The history is bounded. An editor left open for a week with a watcher re-importing a texture every save would otherwise hold every message it ever made.
Fields and properties (4)
public IReadOnlyList<Notification> HistoryWhat has been shown, newest first.
public int HistoryLimitHow many messages are kept.
public TimeSpan DurationHow long an ordinary message stays on screen.
public TimeSpan ErrorDurationHow long a failure stays on screen.
Events (2)
public Action<NotificationCenter>? ChangedRaised when a message arrives or the history is cleared.
public Action<Notification>? ShownRaised for each notification as it is shown, with the entry.
Methods (7)
public NotificationCenter(ToastHost toasts)Shows messages in a document's toast corner.
public Notification Show(string message, NotificationSeverity severity = Info, string? detail = null)Shows a message.
public Notification Success(string message)Shows a message about something that worked.
public Notification Error(string message, string? detail = null)Shows a message about something that did not.
public void Clear()Throws the history away. What is on screen stays there.
public void Tick(TimeSpan time)Tells the corner what time it is, so that expired toasts go away.
public static ControlVariant Variant(NotificationSeverity severity)How a severity is drawn.
Used by (14)
- ConsolePanelTestsVixen.Editor.App.Tests
- ContentTasksVixen.Editor.App
- DeclaredContributionsVixen.Editor.App
- EditorApplicationVixen.Editor.App
- EditorLogVixen.Editor.App
- EditorShellVixen.Editor.Ui
- EditorShellTestsVixen.Editor.Ui.Tests
- MessageLogViewVixen.Editor.Ui
- MilestoneE3TestsVixen.Editor.App.Tests
- ServiceTestsVixen.Editor.Ui.Tests
- TerrainModuleVixen.Editor.Terrain
- TerrainPanelTestsVixen.Editor.App.Tests
- TerrainSessionTestsVixen.Editor.App.Tests
- ViewportChromeVixen.Editor.App