Divided the code into functional modules

This commit is contained in:
2025-07-14 19:58:48 +08:00
parent 8680a08863
commit e9c585e9b6
10 changed files with 1214 additions and 829 deletions

View File

@ -0,0 +1,49 @@
namespace HeartRateMonitorAndroid.Services.Platform
{
/// <summary>
/// Windows平台通知服务实现
/// </summary>
public class WindowsNotificationService : INotificationService
{
/// <summary>
/// 初始化通知服务
/// </summary>
public void Initialize()
{
// Windows平台不需要特殊初始化
}
/// <summary>
/// 显示心率通知
/// </summary>
public void ShowHeartRateNotification(int currentHeartRate, double avgHeartRate, int minHeartRate, int maxHeartRate, TimeSpan duration)
{
string title = "心率监测";
string content = $"当前心率: {currentHeartRate} bpm 平均: {avgHeartRate:0} bpm";
#if WINDOWS
Platforms.Windows.WindowsNotificationHelper.ShowNotification(title, content);
#endif
}
/// <summary>
/// 取消通知
/// </summary>
public void CancelNotification()
{
#if WINDOWS
Platforms.Windows.WindowsNotificationHelper.CancelNotification();
#endif
}
/// <summary>
/// 显示重连通知
/// </summary>
public void ShowReconnectionNotification(string title, string message, int attemptCount)
{
#if WINDOWS
Platforms.Windows.WindowsNotificationHelper.ShowNotification(title, message);
#endif
}
}
}