mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-19 07:01:35 +08:00
798355e342
新增反代脚本只对Steam内置浏览器生效的选项
61 lines
1.6 KiB
C#
61 lines
1.6 KiB
C#
using Ninject;
|
|
using SteamTool.Core;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace SteamTool.Core
|
|
{
|
|
public class SteamToolCore
|
|
{
|
|
private static SteamToolCore instance = null;
|
|
private static readonly object syncRoot = new Object();
|
|
/// <summary>
|
|
/// IoC 容器
|
|
/// </summary>
|
|
private IKernel Kernel { get; set; } = new StandardKernel();
|
|
|
|
|
|
public SteamToolCore()
|
|
{
|
|
Kernel.Bind<ConfigService>().ToConstant(new ConfigService());
|
|
Kernel.Bind<RegistryKeyService>().ToConstant(new RegistryKeyService());
|
|
Kernel.Bind<SteamToolService>().ToSelf();
|
|
Kernel.Bind<VdfService>().To<VdfService>();
|
|
Kernel.Bind<HttpServices>().ToConstant(new HttpServices());
|
|
Kernel.Bind<HostsService>().ToConstant(new HostsService());
|
|
}
|
|
|
|
public TInterface Get<TInterface>()
|
|
{
|
|
return Kernel.Get<TInterface>();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Kernel.Dispose();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建或者从缓存中获取对应业务类的实例
|
|
/// </summary>
|
|
public static SteamToolCore Instance
|
|
{
|
|
get
|
|
{
|
|
if (instance == null)
|
|
{
|
|
lock (syncRoot)
|
|
{
|
|
if (instance == null)
|
|
{
|
|
instance = new SteamToolCore();
|
|
}
|
|
}
|
|
}
|
|
return instance;
|
|
}
|
|
}
|
|
}
|
|
}
|