20 instantiations of PanelAction
Aspire.Tray.Tests (20)
src\Aspire.Tray\Common\TrayPanel.cs (16)
442return new(false, new PanelAction(PanelActionKind.Close)); 674return new(PanelActionKind.OpenDashboard, host, target.Bounds) { Recent = recent }; 679return new(PanelActionKind.Stop, host, target.Bounds) { Recent = recent }; 681return new(PanelActionKind.Start, host, target.Bounds) { Recent = recent }; 690return new(PanelActionKind.OpenIn, host, target.Bounds) 697return new(PanelActionKind.ShowInFolder, host, target.Bounds) { Recent = recent }; 700return new(PanelActionKind.CopyPath, host, target.Bounds) { Recent = recent }; 703return new(PanelActionKind.TogglePin, host, target.Bounds) { Recent = recent }; 706return new(PanelActionKind.RemoveRecent, host, target.Bounds) { Recent = true }; 710return new(PanelActionKind.ToggleRecent, Anchor: target.Bounds); 722PanelConfirmKind.ClearRecent => new(PanelActionKind.ClearRecent, Anchor: target.Bounds), 723_ => new(PanelActionKind.RemoveRecent, host, target.Bounds) { Recent = true } 730return new(PanelActionKind.SetLaunchAtSignIn, Anchor: target.Bounds) { Enabled = _settings?.Startup?.Enabled != true }; 732return new(PanelActionKind.Documentation, Anchor: target.Bounds); 734return new(PanelActionKind.Settings, Anchor: target.Bounds); 736return new(PanelActionKind.Quit, Anchor: target.Bounds);
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (1)
581_execute(new(PanelActionKind.Settings));
TrayPanelTests.cs (3)
230Assert.Equal(new PanelAction(PanelActionKind.OpenIn, host, default) { Application = "Terminal" }, 257Assert.Equal(new PanelAction(PanelActionKind.RemoveRecent, recent, remove.Bounds) { Recent = true }, action); 557Assert.Equal(new PanelAction(PanelActionKind.Stop, state.AppHosts[1], Target(panel, PanelTargetKind.Stop, state.AppHosts[1]).Bounds), action);
21 references to PanelAction
Aspire.Tray.Tests (21)
src\Aspire.Tray\Common\TrayPanel.cs (4)
315var action = Activate(target); 377var action = _pressed is { } pressed && target is { Enabled: true } && target.Key == pressed ? Activate(target) : null; 449var action = Activate(focused); 651private PanelAction? Activate(PanelHitTarget target)
src\Aspire.Tray\Common\TrayPanelScene.cs (3)
279/// Open the AppHost's folder in <see cref="PanelAction.Application"/>, one of 303/// <summary>Turn launch at sign-in on or off, per <see cref="PanelAction.Enabled"/>.</summary> 326internal readonly record struct PanelResponse(bool Redraw, PanelAction? Action = null)
src\Aspire.Tray\Linux\LinuxTrayApplication.cs (2)
602private void ExecutePanelAction(PanelAction action) 615private void ExecutePanelCommand(PanelAction action)
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (2)
13private readonly Action<PanelAction> _execute; 149Action<PanelAction> execute, LinuxPanelBackend backend)
TrayPanelTests.cs (10)
217PanelAction? Pick(PanelTargetKind kind, int item = 0) 225var action = Click(panel, target.HitBounds).Action; 234var pin = Pick(PanelTargetKind.TogglePin); 255var action = Click(panel, remove.HitBounds).Action; 395var start = Click(panel, Target(panel, PanelTargetKind.Start, state.AppHosts[3]).HitBounds).Action; 555var action = Click(panel, Target(panel, PanelTargetKind.Stop, state.AppHosts[1]).HitBounds).Action; 608var action = Click(panel, panel.Scene.Targets.Single(target => target.Kind == PanelTargetKind.Documentation).HitBounds).Action; 658var action = Click(panel, Target(panel, PanelTargetKind.ConfirmAccept, missing).HitBounds).Action; 680var setLaunch = Click(panel, launch.HitBounds).Action; 1356var clear = panel.Invoke(accept).Action;