69 references to PanelActionKind
Aspire.Tray.Tests (69)
src\Aspire.Tray\Common\TrayPanel.cs (17)
258
/// missing on Start. Confirming returns <see cref="
PanelActionKind
.RemoveRecent"/>.
525
return new(false, new PanelAction(
PanelActionKind
.Close));
757
return new(
PanelActionKind
.OpenDashboard, host, target.Bounds) { Recent = recent };
762
return new(
PanelActionKind
.Stop, host, target.Bounds) { Recent = recent };
764
return new(
PanelActionKind
.Start, host, target.Bounds) { Recent = recent };
773
return new(
PanelActionKind
.OpenIn, host, target.Bounds)
780
return new(
PanelActionKind
.ShowInFolder, host, target.Bounds) { Recent = recent };
783
return new(
PanelActionKind
.CopyPath, host, target.Bounds) { Recent = recent };
786
return new(
PanelActionKind
.TogglePin, host, target.Bounds) { Recent = recent };
789
return new(
PanelActionKind
.RemoveRecent, host, target.Bounds) { Recent = true };
793
return new(
PanelActionKind
.ToggleRecent, Anchor: target.Bounds);
805
PanelConfirmKind.ClearRecent => new(
PanelActionKind
.ClearRecent, Anchor: target.Bounds),
806
_ => new(
PanelActionKind
.RemoveRecent, host, target.Bounds) { Recent = true }
813
return new(
PanelActionKind
.SetLaunchAtSignIn, Anchor: target.Bounds) { Enabled = _settings?.Startup?.Enabled != true };
815
return new(
PanelActionKind
.Documentation, Anchor: target.Bounds);
817
return new(
PanelActionKind
.Settings, Anchor: target.Bounds);
819
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)
189
Assert.Equal(
PanelActionKind
.ToggleRecent, response.Action?.Kind);
270
Assert.Equal(new PanelAction(
PanelActionKind
.OpenIn, host, default) { Application = "Terminal" },
272
Assert.Equal(
PanelActionKind
.ShowInFolder, Pick(PanelTargetKind.ShowInFolder)?.Kind);
273
Assert.Equal(
PanelActionKind
.CopyPath, Pick(PanelTargetKind.CopyPath)?.Kind);
275
Assert.Equal(
PanelActionKind
.TogglePin, pin?.Kind);
297
Assert.Equal(new PanelAction(
PanelActionKind
.RemoveRecent, recent, remove.Bounds) { Recent = true }, action);
317
Assert.Equal(
PanelActionKind
.Stop, stop.Action?.Kind);
348
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
433
Assert.Equal(
PanelActionKind
.Stop, Click(panel, Target(panel, PanelTargetKind.Stop, state.AppHosts[0]).HitBounds).Action?.Kind);
434
Assert.Equal(
PanelActionKind
.OpenDashboard, Click(panel, Target(panel, PanelTargetKind.Dashboard, state.AppHosts[0]).HitBounds).Action?.Kind);
436
Assert.Equal(
PanelActionKind
.Start, start?.Kind);
438
Assert.Equal(
PanelActionKind
.Settings, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Settings).HitBounds).Action?.Kind);
439
Assert.Equal(
PanelActionKind
.Quit, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Quit).HitBounds).Action?.Kind);
440
Assert.Equal(
PanelActionKind
.Documentation, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Documentation).HitBounds).Action?.Kind);
480
Assert.Equal(
PanelActionKind
.Stop, response.Action?.Kind);
649
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
661
Assert.Equal(new PanelAction(
PanelActionKind
.Stop, state.AppHosts[1], Target(panel, PanelTargetKind.Stop, state.AppHosts[1]).Bounds), action);
690
Assert.Equal(
PanelActionKind
.Close, panel.Key(PanelKey.Escape).Action?.Kind);
714
Assert.Equal(
PanelActionKind
.Documentation, action?.Kind);
746
Assert.Equal(
PanelActionKind
.ClearRecent, Click(panel, accept.HitBounds).Action?.Kind);
763
Assert.Equal(
PanelActionKind
.RemoveRecent, action?.Kind);
772
Assert.Equal(
PanelActionKind
.Settings, Click(panel, panel.Scene.Targets.Single(t => t.Kind == PanelTargetKind.Settings).HitBounds).Action?.Kind);
785
Assert.Equal(
PanelActionKind
.SetLaunchAtSignIn, setLaunch?.Kind);
1488
Assert.Equal(
PanelActionKind
.ClearRecent, clear?.Kind);
1573
Assert.Equal(
PanelActionKind
.Quit, panel.Invoke(quit.Target.Key).Action?.Kind);