mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-23 10:22:03 +08:00
security fix
This commit is contained in:
@@ -9,6 +9,14 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 尝试添加适用于Desktop的Toast
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection TryAddToast(this IServiceCollection services)
|
||||
=> PlatformToastImpl.TryAddToast(services);
|
||||
|
||||
/// <summary>
|
||||
/// 添加桌面端日志实现
|
||||
/// </summary>
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace System.Application.Services.Implementation
|
||||
{
|
||||
internal sealed class PlatformToastImpl : ToastImpl
|
||||
{
|
||||
public PlatformToastImpl(IToastIntercept intercept) : base(intercept)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void PlatformShow(string text, int duration)
|
||||
{
|
||||
ToastService.Current.Notify(text);
|
||||
}
|
||||
|
||||
internal static IServiceCollection TryAddToast(IServiceCollection services)
|
||||
=> TryAddToast<PlatformToastImpl>(services);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -32,7 +32,7 @@ namespace System.Application.UI.ViewModels
|
||||
DebugString += Services.ToastService.Current.Message + Environment.NewLine;
|
||||
DebugString += Services.ToastService.Current.IsVisible + Environment.NewLine;
|
||||
|
||||
DI.Get<IMessageWindowService>().ShowDialog("Test", "Test");
|
||||
//DI.Get<IMessageWindowService>().ShowDialog("Test", "Test");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user