Use variable instead of global static method

1. introduce variable
2. part of #389
3. refactoring program suffix in program plugin
4. 全局变量一时爽,代码重构火葬场
This commit is contained in:
bao-qian
2016-03-28 03:09:57 +01:00
parent c596039453
commit b22a4501cc
36 changed files with 402 additions and 343 deletions

View File

@@ -5,39 +5,13 @@ namespace Wox.Core.UserSettings
public class HttpProxy : IHttpProxy
{
private static readonly HttpProxy instance = new HttpProxy();
public UserSettingStorage Settings { get; set; }
public static HttpProxy Instance => instance;
private HttpProxy()
{
}
public static HttpProxy Instance
{
get { return instance; }
}
public bool Enabled
{
get { return UserSettingStorage.Instance.ProxyEnabled; }
}
public string Server
{
get { return UserSettingStorage.Instance.ProxyServer; }
}
public int Port
{
get { return UserSettingStorage.Instance.ProxyPort; }
}
public string UserName
{
get { return UserSettingStorage.Instance.ProxyUserName; }
}
public string Password
{
get { return UserSettingStorage.Instance.ProxyPassword; }
}
public bool Enabled => Settings.ProxyEnabled;
public string Server => Settings.ProxyServer;
public int Port => Settings.ProxyPort;
public string UserName => Settings.ProxyUserName;
public string Password => Settings.ProxyPassword;
}
}