mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-20 00:11:04 +08:00
21 lines
737 B
C#
21 lines
737 B
C#
// ReSharper disable once CheckNamespace
|
|
namespace Microsoft.Extensions.DependencyInjection;
|
|
|
|
public static partial class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// 尝试添加由 NotifyIcon 实现的 <see cref="INotificationService"/>
|
|
/// </summary>
|
|
/// <param name="services"></param>
|
|
/// <returns></returns>
|
|
[BD.Mobius(
|
|
"""
|
|
services.AddSingleton<INativeNotificationService, NativeNotificationServiceImpl>();
|
|
""", Obsolete = true)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static IServiceCollection TryAddNotificationService(this IServiceCollection services)
|
|
{
|
|
services.TryAddSingleton<INotificationService, NotificationServiceImpl>();
|
|
return services;
|
|
}
|
|
} |