Files
PulsarK-main/Pulsar.Server/Controls/HeatMapElementHost.cs
T
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

48 lines
1.2 KiB
C#

using System.Windows.Forms;
using System.Windows.Forms.Integration;
using Pulsar.Server.Controls.Wpf;
using Pulsar.Server.Statistics;
#nullable enable
namespace Pulsar.Server.Controls
{
public sealed class HeatMapElementHost : ElementHost
{
private readonly HeatMapView _heatMapView;
private ClientGeoSnapshot? _lastSnapshot;
public HeatMapElementHost()
{
_heatMapView = new HeatMapView();
Child = _heatMapView;
Dock = DockStyle.Fill;
}
public void ShowLoading()
{
_heatMapView.ShowLoading();
}
public void ShowError(string message)
{
_heatMapView.ShowError(message);
}
public void UpdateSnapshot(ClientGeoSnapshot snapshot)
{
_lastSnapshot = snapshot;
_heatMapView.UpdateSnapshot(snapshot);
}
public void ApplyTheme(bool isDarkMode)
{
_heatMapView.ApplyTheme(isDarkMode);
if (_lastSnapshot != null && !_lastSnapshot.HasError)
{
_heatMapView.UpdateSnapshot(_lastSnapshot);
}
}
}
}