mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-29 16:08:15 +08:00
fix
This commit is contained in:
@@ -28,17 +28,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加适用于桌面端的 <see cref="INotificationService"/>
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddNotificationService(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<INotificationService, PlatformNotificationServiceImpl>();
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddFontManager(this IServiceCollection services, bool useGdiPlusFirst)
|
||||
{
|
||||
services.AddSingleton<IFontManager>(new AvaloniaFontManagerImpl(useGdiPlusFirst));
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加 Window 窗口viewmodel
|
||||
/// 添加窗口服务
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
@@ -94,5 +94,16 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
services.AddSingleton<IWindowService, WindowServiceImpl>();
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加适用于桌面端的 <see cref="INotificationService"/>
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddNotificationService(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<INotificationService, PlatformNotificationServiceImpl>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-6
@@ -1,4 +1,3 @@
|
||||
using System.Application.UI;
|
||||
using System.Properties;
|
||||
using System.Windows;
|
||||
|
||||
@@ -18,19 +17,28 @@ namespace System.Application.Services.Implementation
|
||||
|
||||
void INotificationService<NotificationType, Entrance, INotificationService>.Cancel(NotificationType notificationType)
|
||||
{
|
||||
notifyIcon.HideBalloonTip();
|
||||
if (OperatingSystem2.IsWindows)
|
||||
{
|
||||
notifyIcon.HideBalloonTip();
|
||||
}
|
||||
}
|
||||
|
||||
void INotificationService<NotificationType, Entrance, INotificationService>.CancelAll()
|
||||
{
|
||||
notifyIcon.HideBalloonTip();
|
||||
if (OperatingSystem2.IsWindows)
|
||||
{
|
||||
notifyIcon.HideBalloonTip();
|
||||
}
|
||||
}
|
||||
|
||||
void INotificationService<NotificationType, Entrance, INotificationService>.Notify(string text, NotificationType notificationType, bool autoCancel, string? title, Entrance entrance)
|
||||
{
|
||||
title ??= ThisAssembly.AssemblyTrademark;
|
||||
// 调用托盘显示通知
|
||||
notifyIcon.ShowBalloonTip(title, text, ToolTipIcon.None);
|
||||
if (OperatingSystem2.IsWindows)
|
||||
{
|
||||
title ??= ThisAssembly.AssemblyTrademark;
|
||||
// 调用托盘显示通知
|
||||
notifyIcon.ShowBalloonTip(title, text, ToolTipIcon.None);
|
||||
}
|
||||
}
|
||||
|
||||
Progress<float> INotificationService<NotificationType, Entrance, INotificationService>.NotifyDownload(Func<string> text, NotificationType notificationType, string? title)
|
||||
Reference in New Issue
Block a user