Files
rmbgame 798355e342 更新目录结构
新增反代脚本只对Steam内置浏览器生效的选项
2021-01-06 04:30:56 +08:00

61 lines
1.6 KiB
C#

using Ninject;
using SteamTool.Steam.Service;
using SteamTool.Steam.Service.Local;
using SteamTool.Steam.Service.Web;
using System;
namespace SteamTool.Steam.Service
{
public class SteamService
{
private static SteamService instance = null;
private static readonly object syncRoot = new Object();
/// <summary>
/// IoC 容器
/// </summary>
private IKernel Kernel { get; set; } = new StandardKernel();
public SteamService()
{
//Kernel.Bind<SteamworksApiService_1>().To<SteamworksApiService_1>();
Kernel.Bind<SteamworksApiService>().ToConstant(new SteamworksApiService());
Kernel.Bind<SteamDbApiService>().To<SteamDbApiService>();
Kernel.Bind<SteamworksWebApiService>().To<SteamworksWebApiService>();
}
public TInterface Get<TInterface>()
{
return Kernel.Get<TInterface>();
}
public void Dispose()
{
Kernel.Dispose();
}
/// <summary>
/// 创建或者从缓存中获取对应业务类的实例
/// </summary>
public static SteamService Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
{
instance = new SteamService();
}
}
}
return instance;
}
}
}
}