Skip to content

Commit

Permalink
remove AddNotifyIcon<TNotifyIcon>
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Aug 29, 2021
1 parent 7bac01c commit 63ae983
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/ST.Client.Desktop.Avalonia/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@ public static IServiceCollection TryAddFilePickerPlatformService(this IServiceCo
return services;
}

/// <summary>
/// 添加托盘图标
/// </summary>
/// <typeparam name="TNotifyIcon"></typeparam>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection AddNotifyIcon<TNotifyIcon>(this IServiceCollection services) where TNotifyIcon : class, INotifyIcon
{
services.AddSingleton<INotifyIcon<ContextMenu>.IUIFrameworkHelper, INotifyIcon.UIFrameworkHelper>();
services.AddSingleton<TNotifyIcon>();
services.AddSingleton<INotifyIcon>(s => s.GetRequiredService<TNotifyIcon>());
services.AddSingleton<INotifyIcon<ContextMenu>>(s => s.GetRequiredService<TNotifyIcon>());
return services;
}

/// <summary>
/// 添加适用于桌面端的 <see cref="INotificationService"/>
/// </summary>
Expand Down

0 comments on commit 63ae983

Please sign in to comment.