16 instantiations of TrayViewState
Aspire.Tray.Tests (16)
Helpers\TrayPanelSamples.cs (6)
34
public static TrayViewState Typical() =>
new
(DiscoveryState.Live,
51
public static TrayViewState Empty() =>
new
(DiscoveryState.Live, [], "No AppHosts running")
61
public static TrayViewState Connecting() =>
new
(DiscoveryState.Connecting, [], "Connecting to Aspire...");
63
public static TrayViewState Errors() =>
new
(DiscoveryState.Live,
76
public static TrayViewState Disconnected() =>
new
(DiscoveryState.Disconnected,
83
public static TrayViewState Many(int count = 14) =>
new
(DiscoveryState.Live,
src\Aspire.Tray\Common\TrayController.cs (2)
22
private TrayViewState _state =
new
(DiscoveryState.Connecting, [], "Connecting to Aspire...");
626
Volatile.Write(ref _state,
new
(_snapshot.Discovery, rows.ToArray(), status)
TrayIconStatusTests.cs (7)
21
var state = new
TrayViewState
(DiscoveryState.Live,
33
var state = new
TrayViewState
(DiscoveryState.Live, [TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1, (AppHostHealth)health)], "");
42
var failedStop = new
TrayViewState
(DiscoveryState.Live, [running with { Error = "Stop timed out." }], "");
43
var notice = new
TrayViewState
(DiscoveryState.Live, [running], "") { Notice = "Unable to save AppHost history." };
44
var noticeWhileIdle = new
TrayViewState
(DiscoveryState.Live, [], "") { Notice = "Unable to save AppHost history." };
54
var state = new
TrayViewState
(DiscoveryState.Live, [TrayPanelSamples.Offline("/src/A/A.cs", starting: true)], "");
66
var state = new
TrayViewState
((DiscoveryState)discovery, [TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1)], "");
TrayPanelTests.cs (1)
802
var (text, _) = TrayPanel.GetHeaderStatus(
new
((DiscoveryState)discovery, [], ""), TrayPanelPalette.Light);
66 references to TrayViewState
Aspire.Tray.Tests (66)
Helpers\TestAppHostClient.cs (2)
100
var
previous = controller.State;
117
public static async Task WaitForStateAsync(TrayController controller, Func<
TrayViewState
, bool> predicate)
Helpers\TrayPanelSamples.cs (6)
34
public static
TrayViewState
Typical() => new(DiscoveryState.Live,
51
public static
TrayViewState
Empty() => new(DiscoveryState.Live, [], "No AppHosts running")
61
public static
TrayViewState
Connecting() => new(DiscoveryState.Connecting, [], "Connecting to Aspire...");
63
public static
TrayViewState
Errors() => new(DiscoveryState.Live,
76
public static
TrayViewState
Disconnected() => new(DiscoveryState.Disconnected,
83
public static
TrayViewState
Many(int count = 14) => new(DiscoveryState.Live,
src\Aspire.Tray\Common\PanelSettings.cs (1)
7
/// What the panel's Settings view shows besides the values in <see cref="
TrayViewState
"/>. Hosts
src\Aspire.Tray\Common\TrayController.cs (2)
22
private
TrayViewState
_state = new(DiscoveryState.Connecting, [], "Connecting to Aspire...");
76
public
TrayViewState
State => Volatile.Read(ref _state);
src\Aspire.Tray\Common\TrayIconStatus.cs (2)
22
public static TrayIconStatus Get(
TrayViewState
state) => state.Discovery switch
45
private static bool NeedsAttention(
TrayViewState
state)
src\Aspire.Tray\Common\TrayPanel.cs (10)
9
/// collapsed recent list, a row's open action list) and turns <see cref="
TrayViewState
"/> into a
71
private
TrayViewState
_state;
72
private
TrayViewState
? _pendingState;
95
public TrayPanel(
TrayViewState
state, TrayPanelPalette palette)
101
public
TrayViewState
State => _state;
269
public bool Update(
TrayViewState
state)
745
var
state = _state;
1071
private void AddHeader(List<PanelCommand> commands,
TrayViewState
state, TrayPanelPalette palette)
1133
TrayViewState
state, TrayPanelPalette palette)
1584
internal static (string Text, PanelColor Dot) GetHeaderStatus(
TrayViewState
state, TrayPanelPalette palette)
TrayControllerPinPruningTests.cs (1)
173
var
previous = controller.State;
TrayControllerPreferencesTests.cs (1)
138
var
starting = controller.State;
TrayControllerSavedStateTests.cs (3)
34
var
previous = controller.State;
73
var
previous = controller.State;
164
var
previous = controller.State;
TrayIconStatusTests.cs (7)
21
var
state = new TrayViewState(DiscoveryState.Live,
33
var
state = new TrayViewState(DiscoveryState.Live, [TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1, (AppHostHealth)health)], "");
42
var
failedStop = new TrayViewState(DiscoveryState.Live, [running with { Error = "Stop timed out." }], "");
43
var
notice = new TrayViewState(DiscoveryState.Live, [running], "") { Notice = "Unable to save AppHost history." };
44
var
noticeWhileIdle = new TrayViewState(DiscoveryState.Live, [], "") { Notice = "Unable to save AppHost history." };
54
var
state = new TrayViewState(DiscoveryState.Live, [TrayPanelSamples.Offline("/src/A/A.cs", starting: true)], "");
66
var
state = new TrayViewState((DiscoveryState)discovery, [TrayPanelSamples.Running("/src/A/A.AppHost.csproj", 1)], "");
TrayPanelTests.cs (31)
21
private static
TrayViewState
Sample(string name) => name switch
35
var
state = Sample(name);
167
var
state = TrayPanelSamples.Typical();
185
var
state = TrayPanelSamples.Typical();
213
var
state = TrayPanelSamples.Typical();
244
var
state = TrayPanelSamples.Typical();
264
var
state = TrayPanelSamples.Typical();
284
var
state = TrayPanelSamples.Typical();
314
var
state = TrayPanelSamples.Typical();
341
var
state = TrayPanelSamples.Typical();
351
var
state = TrayPanelSamples.Typical();
364
var
state = TrayPanelSamples.Many();
378
var
state = TrayPanelSamples.Typical();
390
var
state = TrayPanelSamples.Typical();
406
var
state = TrayPanelSamples.Typical();
417
var
state = TrayPanelSamples.Typical();
431
var
state = TrayPanelSamples.Typical();
448
var
state = TrayPanelSamples.Typical();
488
var
state = TrayPanelSamples.Many();
501
var
state = TrayPanelSamples.Many();
522
var
state = TrayPanelSamples.Typical();
552
var
state = TrayPanelSamples.Typical();
565
var
state = TrayPanelSamples.Errors();
617
var
state = TrayPanelSamples.Typical();
649
var
state = TrayPanelSamples.Typical();
741
var
state = TrayPanelSamples.Typical();
995
var
state = TrayPanelSamples.Typical();
1124
var
state = TrayPanelSamples.Typical();
1310
var
state = TrayPanelSamples.Typical();
1361
var
state = TrayPanelSamples.Typical();
1409
var
state = TrayPanelSamples.Typical();