Class SerenityHubLauncher
Launches a real Tools/Serenity/... tool exactly the way a direct menu click would
(UnityEditor.EditorApplication.ExecuteMenuItem(System.String)) and records it as a Hub-originated recent. This is the
single choke point every catalog card, search result, and Home recent/favorite click launches through, so
that "recents record only Hub-originated launches" (spec §8) holds without instrumenting individual tools.
A recent is only ever recorded for a launch UnityEditor.EditorApplication.ExecuteMenuItem(System.String) itself reports
as having found and executed — a stale MenuPath that resolves to nothing must not be remembered as
if the tool had opened.
Inherited Members
Namespace: Serenity.Hub.Infrastructure.Editor.Services
Assembly: Serenity.UnityHub.Infrastructure.Editor.dll
Syntax
public sealed class SerenityHubLauncher
Constructors
SerenityHubLauncher(SerenityHubRecents, Func<string, bool>, Action<string>)
A null log drops the stale-path warning silently instead of throwing — the two
composition edges that wire this, SerenityHubWindow and InitializeSerenityWindow, both
supply a real logger, so this only matters for a caller that deliberately omits one.
Declaration
public SerenityHubLauncher(SerenityHubRecents recents, Func<string, bool> executeMenuItem = null, Action<string> log = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityHubRecents | recents | |
| Func<string, bool> | executeMenuItem | |
| Action<string> | log |
Methods
Launch(string)
Executes the menu item at menuPath and, only if it was actually found and executed,
records it as a recent. Returns whether the launch succeeded, for callers that choose to react.
Declaration
public bool Launch(string menuPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | menuPath |
Returns
| Type | Description |
|---|---|
| bool |