78 references to DashboardConnectionState
Aspire.Dashboard (32)
Components\Controls\ApplicationName.razor.cs (2)
51
private async void OnConnectionStateChanged(
DashboardConnectionState
state)
53
if (state is not
DashboardConnectionState
.Connected)
Components\Layout\ResourceServiceConnectionProvider.cs (7)
42
if (DashboardClient.ConnectionState is
DashboardConnectionState
.Disconnected or
DashboardConnectionState
.Unsupported)
49
private async void OnConnectionStateChanged(
DashboardConnectionState
state)
69
private async Task UpdateModalStateAsync(
DashboardConnectionState
state)
71
if (state is
DashboardConnectionState
.Connected)
76
else if (state is
DashboardConnectionState
.Unsupported)
81
else if (state is
DashboardConnectionState
.Disconnected)
ServiceClient\DashboardClient.cs (18)
78
private
DashboardConnectionState
_connectionState;
288
public
DashboardConnectionState
ConnectionState => _connectionState;
290
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
312
private void SetConnectionState(
DashboardConnectionState
state)
326
if (state is
DashboardConnectionState
.Connected)
332
else if (state is
DashboardConnectionState
.Disconnected or
DashboardConnectionState
.Connecting or
DashboardConnectionState
.Unsupported)
367
SetConnectionState(
DashboardConnectionState
.Connecting);
423
SetConnectionState(
DashboardConnectionState
.Disconnected);
456
SetConnectionState(
DashboardConnectionState
.Connecting);
471
SetConnectionState(
DashboardConnectionState
.Unsupported);
475
SetConnectionState(
DashboardConnectionState
.Connected);
511
SetConnectionState(
DashboardConnectionState
.Disconnected);
554
SetConnectionState(
DashboardConnectionState
.Connecting);
710
SetConnectionState(
DashboardConnectionState
.Connected);
772
SetConnectionState(
DashboardConnectionState
.Connected);
1312
internal void SetConnectionStateForTesting(
DashboardConnectionState
state) => SetConnectionState(state);
ServiceClient\IDashboardClient.cs (2)
35
DashboardConnectionState
ConnectionState { get; }
40
event Action<
DashboardConnectionState
>? ConnectionStateChanged;
ServiceClient\SelectedDashboardClient.cs (3)
15
public
DashboardConnectionState
ConnectionState => IsReadOnly ?
DashboardConnectionState
.Connected : currentClient.ConnectionState;
22
public event Action<
DashboardConnectionState
>? ConnectionStateChanged
Aspire.Dashboard.Components.Tests (7)
Layout\MainLayoutTerminalTests.cs (1)
65
await cut.InvokeAsync(() => client.SetConnectionState(
DashboardConnectionState
.Disconnected));
Layout\ResourceServiceConnectionProviderTests.cs (1)
24
await cut.InvokeAsync(() => dashboardClient.SetConnectionState(
DashboardConnectionState
.Disconnected));
tests\Shared\TestDashboardClient.cs (5)
17
private
DashboardConnectionState
_connectionState =
DashboardConnectionState
.Connected;
37
public
DashboardConnectionState
ConnectionState => _connectionState;
47
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
87
public void SetConnectionState(
DashboardConnectionState
state)
Aspire.Dashboard.Tests (39)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (3)
47
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
49
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
Model\DashboardClientTests.cs (21)
595
Assert.Equal(
DashboardConnectionState
.Connecting, client.ConnectionState);
660
var stateChanges = new List<
DashboardConnectionState
>();
663
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
665
Assert.Equal(
DashboardConnectionState
.Connected, client.ConnectionState);
667
Assert.Equal(
DashboardConnectionState
.Connected, stateChanges[0]);
676
var stateChanges = new List<
DashboardConnectionState
>();
679
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
680
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
691
var stateChanges = new List<
DashboardConnectionState
>();
695
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
696
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
698
Assert.Equal(
DashboardConnectionState
.Disconnected, client.ConnectionState);
700
s => Assert.Equal(
DashboardConnectionState
.Connected, s),
701
s => Assert.Equal(
DashboardConnectionState
.Disconnected, s));
727
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
746
if (state ==
DashboardConnectionState
.Disconnected)
780
if (state ==
DashboardConnectionState
.Disconnected)
807
if (state ==
DashboardConnectionState
.Unsupported)
817
Assert.Equal(
DashboardConnectionState
.Unsupported, client.ConnectionState);
859
if (state ==
DashboardConnectionState
.Connected)
869
Assert.Equal(
DashboardConnectionState
.Connected, client.ConnectionState);
Model\DashboardDataSourceTests.cs (4)
1485
currentClient.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
1489
Assert.Equal(
DashboardConnectionState
.Connected, selectedClient.ConnectionState);
1501
Action<
DashboardConnectionState
> handler = _ => connectionStateChangedCount++;
1506
currentClient.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
ResourceOutgoingPeerResolverTests.cs (3)
689
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
691
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
Terminal\DefaultTerminalConnectionResolverTests.cs (3)
146
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
148
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
tests\Shared\TestDashboardClient.cs (5)
17
private
DashboardConnectionState
_connectionState =
DashboardConnectionState
.Connected;
37
public
DashboardConnectionState
ConnectionState => _connectionState;
47
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
87
public void SetConnectionState(
DashboardConnectionState
state)