mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-20 00:11:04 +08:00
f483a5dcba
新增平台架构(win/mac/linux) 优化 发布配置
23 lines
690 B
C#
23 lines
690 B
C#
using System;
|
|
using System.Application.Services;
|
|
using System.Application.Services.Implementation;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddDesktopPlatformService(this IServiceCollection services)
|
|
{
|
|
if (DI.Platform == Platform.Linux)
|
|
{
|
|
services.AddSingleton<IDesktopPlatformService, LinuxDesktopPlatformServiceImpl>();
|
|
}
|
|
else
|
|
{
|
|
throw new PlatformNotSupportedException();
|
|
}
|
|
return services;
|
|
}
|
|
}
|
|
} |