88 references to DashboardConnectionState
Aspire.Dashboard (32)
Components\Controls\ApplicationName.razor.cs (2)
51private async void OnConnectionStateChanged(DashboardConnectionState state) 53if (state is not DashboardConnectionState.Connected)
Components\Layout\ResourceServiceConnectionProvider.cs (7)
42if (DashboardClient.ConnectionState is DashboardConnectionState.Disconnected or DashboardConnectionState.Unsupported) 49private async void OnConnectionStateChanged(DashboardConnectionState state) 69private async Task UpdateModalStateAsync(DashboardConnectionState state) 71if (state is DashboardConnectionState.Connected) 76else if (state is DashboardConnectionState.Unsupported) 81else if (state is DashboardConnectionState.Disconnected)
ServiceClient\DashboardClient.cs (18)
78private DashboardConnectionState _connectionState; 288public DashboardConnectionState ConnectionState => _connectionState; 290public event Action<DashboardConnectionState>? ConnectionStateChanged; 312private void SetConnectionState(DashboardConnectionState state) 326if (state is DashboardConnectionState.Connected) 332else if (state is DashboardConnectionState.Disconnected or DashboardConnectionState.Connecting or DashboardConnectionState.Unsupported) 363SetConnectionState(DashboardConnectionState.Connecting); 419SetConnectionState(DashboardConnectionState.Disconnected); 452SetConnectionState(DashboardConnectionState.Connecting); 467SetConnectionState(DashboardConnectionState.Unsupported); 471SetConnectionState(DashboardConnectionState.Connected); 520SetConnectionState(DashboardConnectionState.Disconnected); 563SetConnectionState(DashboardConnectionState.Connecting); 724SetConnectionState(DashboardConnectionState.Connected); 786SetConnectionState(DashboardConnectionState.Connected); 1339internal void SetConnectionStateForTesting(DashboardConnectionState state) => SetConnectionState(state);
ServiceClient\IDashboardClient.cs (2)
45DashboardConnectionState ConnectionState { get; } 50event Action<DashboardConnectionState>? ConnectionStateChanged;
ServiceClient\SelectedDashboardClient.cs (3)
16public DashboardConnectionState ConnectionState => IsReadOnly ? DashboardConnectionState.Connected : currentClient.ConnectionState; 23public event Action<DashboardConnectionState>? ConnectionStateChanged
Aspire.Dashboard.Components.Tests (7)
Layout\MainLayoutTerminalTests.cs (1)
65await cut.InvokeAsync(() => client.SetConnectionState(DashboardConnectionState.Disconnected));
Layout\ResourceServiceConnectionProviderTests.cs (1)
24await cut.InvokeAsync(() => dashboardClient.SetConnectionState(DashboardConnectionState.Disconnected));
tests\Shared\TestDashboardClient.cs (5)
17private DashboardConnectionState _connectionState = DashboardConnectionState.Connected; 40public DashboardConnectionState ConnectionState => _connectionState; 53public event Action<DashboardConnectionState>? ConnectionStateChanged; 95public void SetConnectionState(DashboardConnectionState state)
Aspire.Dashboard.Playwright.Tests (8)
tests\Aspire.Dashboard.Tests\Shared\MockDashboardClient.cs (3)
48public DashboardConnectionState ConnectionState => DashboardConnectionState.Connected; 50public event Action<DashboardConnectionState>? ConnectionStateChanged;
tests\Shared\TestDashboardClient.cs (5)
17private DashboardConnectionState _connectionState = DashboardConnectionState.Connected; 40public DashboardConnectionState ConnectionState => _connectionState; 53public event Action<DashboardConnectionState>? ConnectionStateChanged; 95public void SetConnectionState(DashboardConnectionState state)
Aspire.Dashboard.Tests (41)
Model\DashboardClientTests.cs (23)
551if (state == DashboardConnectionState.Disconnected) 555else if (state == DashboardConnectionState.Connected && disconnected.Task.IsCompleted) 780Assert.Equal(DashboardConnectionState.Connecting, client.ConnectionState); 845var stateChanges = new List<DashboardConnectionState>(); 848instance.SetConnectionStateForTesting(DashboardConnectionState.Connected); 850Assert.Equal(DashboardConnectionState.Connected, client.ConnectionState); 852Assert.Equal(DashboardConnectionState.Connected, stateChanges[0]); 861var stateChanges = new List<DashboardConnectionState>(); 864instance.SetConnectionStateForTesting(DashboardConnectionState.Connected); 865instance.SetConnectionStateForTesting(DashboardConnectionState.Connected); 876var stateChanges = new List<DashboardConnectionState>(); 880instance.SetConnectionStateForTesting(DashboardConnectionState.Connected); 881instance.SetConnectionStateForTesting(DashboardConnectionState.Disconnected); 883Assert.Equal(DashboardConnectionState.Disconnected, client.ConnectionState); 885s => Assert.Equal(DashboardConnectionState.Connected, s), 886s => Assert.Equal(DashboardConnectionState.Disconnected, s)); 912instance.SetConnectionStateForTesting(DashboardConnectionState.Disconnected); 931if (state == DashboardConnectionState.Disconnected) 965if (state == DashboardConnectionState.Disconnected) 992if (state == DashboardConnectionState.Unsupported) 1002Assert.Equal(DashboardConnectionState.Unsupported, client.ConnectionState); 1044if (state == DashboardConnectionState.Connected) 1054Assert.Equal(DashboardConnectionState.Connected, client.ConnectionState);
Model\DashboardDataSourceTests.cs (4)
1488currentClient.SetConnectionStateForTesting(DashboardConnectionState.Disconnected); 1493Assert.Equal(DashboardConnectionState.Connected, selectedClient.ConnectionState); 1505Action<DashboardConnectionState> handler = _ => connectionStateChangedCount++; 1510currentClient.SetConnectionStateForTesting(DashboardConnectionState.Connected);
ResourceOutgoingPeerResolverTests.cs (3)
690public DashboardConnectionState ConnectionState => DashboardConnectionState.Connected; 692public event Action<DashboardConnectionState>? ConnectionStateChanged;
Shared\MockDashboardClient.cs (3)
48public DashboardConnectionState ConnectionState => DashboardConnectionState.Connected; 50public event Action<DashboardConnectionState>? ConnectionStateChanged;
Terminal\DefaultTerminalConnectionResolverTests.cs (3)
190public DashboardConnectionState ConnectionState => DashboardConnectionState.Connected; 192public event Action<DashboardConnectionState>? ConnectionStateChanged;
tests\Shared\TestDashboardClient.cs (5)
17private DashboardConnectionState _connectionState = DashboardConnectionState.Connected; 40public DashboardConnectionState ConnectionState => _connectionState; 53public event Action<DashboardConnectionState>? ConnectionStateChanged; 95public void SetConnectionState(DashboardConnectionState state)