initial commit
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run

This commit is contained in:
i2p
2026-08-27 10:57:58 -06:00
commit 773d05f8f1
1038 changed files with 109261 additions and 0 deletions
@@ -0,0 +1,47 @@
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 StatsElementHost : ElementHost
{
private readonly StatsView _statsView;
private ClientStatisticsSnapshot? _lastSnapshot;
public StatsElementHost()
{
_statsView = new StatsView();
Child = _statsView;
Dock = DockStyle.Fill;
}
public void ShowLoading()
{
_statsView.ShowLoading();
}
public void ShowError(string message)
{
_statsView.ShowError(message);
}
public void UpdateSnapshot(ClientStatisticsSnapshot snapshot)
{
_lastSnapshot = snapshot;
_statsView.UpdateSnapshot(snapshot);
}
public void ApplyTheme(bool isDarkMode)
{
_statsView.ApplyTheme(isDarkMode);
if (_lastSnapshot != null && !_lastSnapshot.HasError)
{
_statsView.UpdateSnapshot(_lastSnapshot);
}
}
}
}