88 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)
363
SetConnectionState(
DashboardConnectionState
.Connecting);
419
SetConnectionState(
DashboardConnectionState
.Disconnected);
452
SetConnectionState(
DashboardConnectionState
.Connecting);
467
SetConnectionState(
DashboardConnectionState
.Unsupported);
471
SetConnectionState(
DashboardConnectionState
.Connected);
520
SetConnectionState(
DashboardConnectionState
.Disconnected);
563
SetConnectionState(
DashboardConnectionState
.Connecting);
724
SetConnectionState(
DashboardConnectionState
.Connected);
786
SetConnectionState(
DashboardConnectionState
.Connected);
1339
internal void SetConnectionStateForTesting(
DashboardConnectionState
state) => SetConnectionState(state);
ServiceClient\IDashboardClient.cs (2)
45
DashboardConnectionState
ConnectionState { get; }
50
event Action<
DashboardConnectionState
>? ConnectionStateChanged;
ServiceClient\SelectedDashboardClient.cs (3)
16
public
DashboardConnectionState
ConnectionState => IsReadOnly ?
DashboardConnectionState
.Connected : currentClient.ConnectionState;
23
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;
40
public
DashboardConnectionState
ConnectionState => _connectionState;
53
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
95
public void SetConnectionState(
DashboardConnectionState
state)
Aspire.Dashboard.Playwright.Tests (8)
tests\Aspire.Dashboard.Tests\Shared\MockDashboardClient.cs (3)
48
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
50
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
tests\Shared\TestDashboardClient.cs (5)
17
private
DashboardConnectionState
_connectionState =
DashboardConnectionState
.Connected;
40
public
DashboardConnectionState
ConnectionState => _connectionState;
53
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
95
public void SetConnectionState(
DashboardConnectionState
state)
Aspire.Dashboard.Tests (41)
Model\DashboardClientTests.cs (23)
551
if (state ==
DashboardConnectionState
.Disconnected)
555
else if (state ==
DashboardConnectionState
.Connected && disconnected.Task.IsCompleted)
780
Assert.Equal(
DashboardConnectionState
.Connecting, client.ConnectionState);
845
var stateChanges = new List<
DashboardConnectionState
>();
848
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
850
Assert.Equal(
DashboardConnectionState
.Connected, client.ConnectionState);
852
Assert.Equal(
DashboardConnectionState
.Connected, stateChanges[0]);
861
var stateChanges = new List<
DashboardConnectionState
>();
864
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
865
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
876
var stateChanges = new List<
DashboardConnectionState
>();
880
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
881
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
883
Assert.Equal(
DashboardConnectionState
.Disconnected, client.ConnectionState);
885
s => Assert.Equal(
DashboardConnectionState
.Connected, s),
886
s => Assert.Equal(
DashboardConnectionState
.Disconnected, s));
912
instance.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
931
if (state ==
DashboardConnectionState
.Disconnected)
965
if (state ==
DashboardConnectionState
.Disconnected)
992
if (state ==
DashboardConnectionState
.Unsupported)
1002
Assert.Equal(
DashboardConnectionState
.Unsupported, client.ConnectionState);
1044
if (state ==
DashboardConnectionState
.Connected)
1054
Assert.Equal(
DashboardConnectionState
.Connected, client.ConnectionState);
Model\DashboardDataSourceTests.cs (4)
1488
currentClient.SetConnectionStateForTesting(
DashboardConnectionState
.Disconnected);
1493
Assert.Equal(
DashboardConnectionState
.Connected, selectedClient.ConnectionState);
1505
Action<
DashboardConnectionState
> handler = _ => connectionStateChangedCount++;
1510
currentClient.SetConnectionStateForTesting(
DashboardConnectionState
.Connected);
ResourceOutgoingPeerResolverTests.cs (3)
690
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
692
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
Shared\MockDashboardClient.cs (3)
48
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
50
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
Terminal\DefaultTerminalConnectionResolverTests.cs (3)
190
public
DashboardConnectionState
ConnectionState =>
DashboardConnectionState
.Connected;
192
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
tests\Shared\TestDashboardClient.cs (5)
17
private
DashboardConnectionState
_connectionState =
DashboardConnectionState
.Connected;
40
public
DashboardConnectionState
ConnectionState => _connectionState;
53
public event Action<
DashboardConnectionState
>? ConnectionStateChanged;
95
public void SetConnectionState(
DashboardConnectionState
state)