12 instantiations of AppHostMenuItem
Aspire.Tray.Tests (12)
Helpers\TrayPanelSamples.cs (2)
14return new(id, AppHostPresentation.GetTitle(info), AppHostPresentation.GetSubtitle(info), AppHostPresentation.GetDisplayName(info), 24return new(info.Id, AppHostPresentation.GetTitle(info), error ?? subtitle, AppHostPresentation.GetDisplayName(info),
LinuxTrayTests.cs (8)
431var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 451var host = new AppHostMenuItem(id, "Example", "PID 42", "Example", true, true, false, null) 481var host = new AppHostMenuItem(new(path, 42, 1000), "Shop", "PID 42", "Shop", true, true, false, null); 504var host = new AppHostMenuItem(new(path, 42, 1000), "Shop", path, "Shop", true, true, false, null); 582var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 593var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 611var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 0, null), 636var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2),
src\Aspire.Tray\Common\TrayController.cs (2)
581return new AppHostMenuItem(host.Id, AppHostPresentation.GetTitle(host), subtitle, 644return new(host.Id, AppHostPresentation.GetTitle(host), subtitle, AppHostPresentation.GetDisplayName(host),
68 references to AppHostMenuItem
Aspire.Tray.Tests (68)
Helpers\TrayPanelSamples.cs (2)
9public static AppHostMenuItem Running(string path, int pid, AppHostHealth health = AppHostHealth.Healthy, bool dashboard = true, 21public static AppHostMenuItem Offline(string path, bool pinned = true, bool starting = false, string? error = null, string subtitle = "Stopped")
LinuxTrayTests.cs (12)
75var offline = TrayPanelSamples.Offline(Path.GetFullPath("Offline.AppHost/apphost.cs")); 76var running = TrayPanelSamples.Running(Path.GetFullPath("Running.AppHost/apphost.cs"), 42) with { IsPinned = true }; 334var host = Assert.Single(controller.State.RecentAppHosts); 431var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 451var host = new AppHostMenuItem(id, "Example", "PID 42", "Example", true, true, false, null) 481var host = new AppHostMenuItem(new(path, 42, 1000), "Shop", "PID 42", "Shop", true, true, false, null); 482var recent = host with { Id = new(path, 0, null), IsRunning = false, CanStart = true }; 504var host = new AppHostMenuItem(new(path, 42, 1000), "Shop", path, "Shop", true, true, false, null); 582var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 593var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 611var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 0, null), 636var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2),
src\Aspire.Tray\Common\IAppHostClient.cs (2)
86IReadOnlyList<AppHostMenuItem> AppHosts, 89public IReadOnlyList<AppHostMenuItem> RecentAppHosts { get; init; } = [];
src\Aspire.Tray\Common\TrayController.cs (1)
636private AppHostMenuItem CreateSavedMenuItem(SavedAppHost saved, bool live)
src\Aspire.Tray\Common\TrayPanel.cs (16)
260public PanelResponse ConfirmRemoveMissing(AppHostMenuItem host) 736var host = target.Host; 860void Add(ListItemKind kind, double height, PanelSection section, AppHostMenuItem? host, PanelTargetKind target = default) 866void AddSection(PanelSection section, IReadOnlyList<AppHostMenuItem> hosts, bool expanded) 886foreach (var host in hosts) 1282private void AddRow(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1370private List<(PanelTargetKind Kind, int Item, PanelIcon Icon, string Label, string Name)> GetRowActions(AppHostMenuItem host, PanelSection section) 1401private void AddActions(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1453var current = confirm.Kind switch 1473private void AddConfirm(List<PanelCommand> commands, List<PanelHitTarget> targets, PanelConfirm confirm, AppHostMenuItem? host, 1622private void AddTarget(List<PanelHitTarget> targets, PanelTargetKey key, PanelRect bounds, string name, bool enabled, AppHostMenuItem? host, 1653internal static PanelStatusGlyph GetStatusGlyph(AppHostMenuItem host, bool live) => host switch 1669internal static (string Text, bool IsError) GetRowDetail(AppHostMenuItem host, bool live, bool showPid) 1692private static string GetRowAccessibleName(AppHostMenuItem host, string detail) => $"{host.DisplayName}, {detail}"; 1746private readonly record struct ListItem(ListItemKind Kind, double Y, double Height, PanelSection Section, AppHostMenuItem? Host, 1750private sealed record PanelConfirm(PanelConfirmKind Kind, PanelSection Section, AppHostMenuItem? Host);
src\Aspire.Tray\Common\TrayPanelScene.cs (2)
193AppHostMenuItem? Host, 313internal sealed record PanelAction(PanelActionKind Kind, AppHostMenuItem? Host = null, PanelRect Anchor = default)
src\Aspire.Tray\Linux\LinuxTrayApplication.cs (1)
488var host = item.Host;
src\Aspire.Tray\Linux\LinuxTrayMenu.cs (4)
10AppHostMenuItem? Host = null, bool Enabled = true, IReadOnlyList<LinuxTrayMenuItem>? Children = null) 54void AddSection(string title, IEnumerable<AppHostMenuItem> hosts) 66LinuxTrayMenuItem Host(AppHostMenuItem host, bool recent) 120private static string Status(AppHostMenuItem host)
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (1)
263internal void ConfirmRemoveMissing(AppHostMenuItem host) => Apply(_panel.ConfirmRemoveMissing(host));
TrayControllerPinPruningTests.cs (1)
90var row = Assert.Single(controller.State.AppHosts);
TrayControllerSavedStateTests.cs (9)
43var row = Assert.Single(controller.State.AppHosts.Concat(controller.State.RecentAppHosts)); 86var row = Assert.Single(controller.State.AppHosts); 183var row = Assert.Single(controller.State.RecentAppHosts); 227var row = Assert.Single(controller.State.AppHosts); 259var live = Assert.Single(controller.State.AppHosts); 275var offline = Assert.Single(controller.State.AppHosts); 409var timedOut = Assert.Single(controller.State.RecentAppHosts); 417var row = Assert.Single(controller.State.AppHosts); 506var row = Assert.Single(controller.State.AppHosts);
TrayIconStatusTests.cs (1)
41var running = TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1);
TrayPanelTests.cs (16)
103foreach (var host in state.AppHosts) 134foreach (var host in new[] { state.AppHosts[0], state.AppHosts[3] }) 210foreach (var host in state.AppHosts) 227var host = state.AppHosts[2]; 255var host = state.AppHosts[0]; 292var recent = state.RecentAppHosts[0]; 356var host = state.AppHosts[0]; 406var last = state.AppHosts[^1]; 671var stopping = state.AppHosts.Single(host => host.IsStopping); 672var starting = state.AppHosts.Single(host => host.IsStarting); 755var missing = state.RecentAppHosts[1]; 964var host = TrayPanelSamples.Running("/Users/dev/src/eShop/src/eShop.AppHost/eShop.AppHost.csproj", 48213, AppHostHealth.Warning); 990var host = TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1, (AppHostHealth)health, stopping: stopping, error: error ? "Failed." : null); 1586var running = state.AppHosts[0]; 1587var stopped = state.AppHosts[3]; 1629private static PanelHitTarget Target(TrayPanel panel, PanelTargetKind kind, AppHostMenuItem host)