69 references to PanelActionKind
Aspire.Tray.Tests (69)
src\Aspire.Tray\Common\TrayPanel.cs (17)
253
/// missing on Start. Confirming returns <see cref="
PanelActionKind
.RemoveRecent"/>.
442
return new(false, new PanelAction(
PanelActionKind
.Close));
674
return new(
PanelActionKind
.OpenDashboard, host, target.Bounds) { Recent = recent };
679
return new(
PanelActionKind
.Stop, host, target.Bounds) { Recent = recent };
681
return new(
PanelActionKind
.Start, host, target.Bounds) { Recent = recent };
690
return new(
PanelActionKind
.OpenIn, host, target.Bounds)
697
return new(
PanelActionKind
.ShowInFolder, host, target.Bounds) { Recent = recent };
700
return new(
PanelActionKind
.CopyPath, host, target.Bounds) { Recent = recent };
703
return new(
PanelActionKind
.TogglePin, host, target.Bounds) { Recent = recent };
706
return new(
PanelActionKind
.RemoveRecent, host, target.Bounds) { Recent = true };
710
return new(
PanelActionKind
.ToggleRecent, Anchor: target.Bounds);
722
PanelConfirmKind.ClearRecent => new(
PanelActionKind
.ClearRecent, Anchor: target.Bounds),
723
_ => new(
PanelActionKind
.RemoveRecent, host, target.Bounds) { Recent = true }
730
return new(
PanelActionKind
.SetLaunchAtSignIn, Anchor: target.Bounds) { Enabled = _settings?.Startup?.Enabled != true };
732
return new(
PanelActionKind
.Documentation, Anchor: target.Bounds);
734
return new(
PanelActionKind
.Settings, Anchor: target.Bounds);
736
return new(
PanelActionKind
.Quit, Anchor: target.Bounds);
src\Aspire.Tray\Common\TrayPanelScene.cs (2)
313
internal sealed record PanelAction(
PanelActionKind
Kind, AppHostMenuItem? Host = null, PanelRect Anchor = default)
321
/// <summary>For <see cref="
PanelActionKind
.OpenIn"/>: the title of the application to open the folder in.</summary>
src\Aspire.Tray\Linux\LinuxTrayApplication.cs (24)
619
case
PanelActionKind
.Settings:
622
case
PanelActionKind
.SetLaunchAtSignIn:
625
case
PanelActionKind
.ClearRecent:
628
case
PanelActionKind
.Close:
631
case
PanelActionKind
.ToggleRecent:
634
if (action.Kind is
PanelActionKind
.Start or
PanelActionKind
.OpenIn or
PanelActionKind
.ShowInFolder
648
if (action.Kind is
PanelActionKind
.OpenDashboard or
PanelActionKind
.Documentation or
PanelActionKind
.OpenIn
649
or
PanelActionKind
.ShowInFolder or
PanelActionKind
.Quit)
655
PanelActionKind
.OpenDashboard => LinuxTrayAction.Dashboard,
656
PanelActionKind
.Stop => LinuxTrayAction.Stop,
657
PanelActionKind
.Start => LinuxTrayAction.Start,
658
PanelActionKind
.OpenIn => LinuxTrayAction.OpenIn,
659
PanelActionKind
.ShowInFolder => LinuxTrayAction.Folder,
660
PanelActionKind
.CopyPath => LinuxTrayAction.CopyPath,
661
PanelActionKind
.TogglePin => LinuxTrayAction.TogglePin,
662
PanelActionKind
.RemoveRecent => LinuxTrayAction.RemoveRecent,
663
PanelActionKind
.Documentation => LinuxTrayAction.Documentation,
664
PanelActionKind
.Quit => LinuxTrayAction.Quit,
669
Application = action.Kind ==
PanelActionKind
.OpenIn
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (1)
581
_execute(new(
PanelActionKind
.Settings));
TrayPanelTests.cs (25)
149
Assert.Equal(
PanelActionKind
.ToggleRecent, response.Action?.Kind);
230
Assert.Equal(new PanelAction(
PanelActionKind
.OpenIn, host, default) { Application = "Terminal" },
232
Assert.Equal(
PanelActionKind
.ShowInFolder, Pick(PanelTargetKind.ShowInFolder)?.Kind);
233
Assert.Equal(
PanelActionKind
.CopyPath, Pick(PanelTargetKind.CopyPath)?.Kind);
235
Assert.Equal(
PanelActionKind
.TogglePin, pin?.Kind);
257
Assert.Equal(new PanelAction(
PanelActionKind
.RemoveRecent, recent, remove.Bounds) { Recent = true }, action);
277
Assert.Equal(
PanelActionKind
.Stop, stop.Action?.Kind);
308
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
393
Assert.Equal(
PanelActionKind
.Stop, Click(panel, Target(panel, PanelTargetKind.Stop, state.AppHosts[0]).HitBounds).Action?.Kind);
394
Assert.Equal(
PanelActionKind
.OpenDashboard, Click(panel, Target(panel, PanelTargetKind.Dashboard, state.AppHosts[0]).HitBounds).Action?.Kind);
396
Assert.Equal(
PanelActionKind
.Start, start?.Kind);
398
Assert.Equal(
PanelActionKind
.Settings, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Settings).HitBounds).Action?.Kind);
399
Assert.Equal(
PanelActionKind
.Quit, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Quit).HitBounds).Action?.Kind);
400
Assert.Equal(
PanelActionKind
.Documentation, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Documentation).HitBounds).Action?.Kind);
440
Assert.Equal(
PanelActionKind
.Stop, response.Action?.Kind);
545
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
557
Assert.Equal(new PanelAction(
PanelActionKind
.Stop, state.AppHosts[1], Target(panel, PanelTargetKind.Stop, state.AppHosts[1]).Bounds), action);
586
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
610
Assert.Equal(
PanelActionKind
.Documentation, action?.Kind);
642
Assert.Equal(
PanelActionKind
.ClearRecent, Click(panel, accept.HitBounds).Action?.Kind);
659
Assert.Equal(
PanelActionKind
.RemoveRecent, action?.Kind);
668
Assert.Equal(
PanelActionKind
.Settings, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Settings).HitBounds).Action?.Kind);
681
Assert.Equal(
PanelActionKind
.SetLaunchAtSignIn, setLaunch?.Kind);
1357
Assert.Equal(
PanelActionKind
.ClearRecent, clear?.Kind);
1444
Assert.Equal(
PanelActionKind
.Quit, panel.Invoke(quit.Target.Key).Action?.Kind);