mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user