Also, fix typo in ProxyForm Signed-off-by: Syrone Wong <wong.syrone@gmail.com>tags/3.3.3
@@ -95,7 +95,6 @@ namespace Shadowsocks.Controller | |||||
class TCPHandler | class TCPHandler | ||||
{ | { | ||||
class AsyncSession | class AsyncSession | ||||
{ | { | ||||
public IProxy Remote { get; } | public IProxy Remote { get; } | ||||
@@ -121,6 +120,8 @@ namespace Shadowsocks.Controller | |||||
} | } | ||||
} | } | ||||
private readonly int _serverTimeout; | |||||
private readonly int _proxyTimeout; | |||||
// Size of receive buffer. | // Size of receive buffer. | ||||
public static readonly int RecvSize = 8192; | public static readonly int RecvSize = 8192; | ||||
@@ -169,10 +170,12 @@ namespace Shadowsocks.Controller | |||||
public TCPHandler(ShadowsocksController controller, Configuration config, TCPRelay tcprelay, Socket socket) | public TCPHandler(ShadowsocksController controller, Configuration config, TCPRelay tcprelay, Socket socket) | ||||
{ | { | ||||
this._controller = controller; | |||||
this._config = config; | |||||
this._tcprelay = tcprelay; | |||||
this._connection = socket; | |||||
_controller = controller; | |||||
_config = config; | |||||
_tcprelay = tcprelay; | |||||
_connection = socket; | |||||
_proxyTimeout = config.proxy.proxyTimeout * 1000; | |||||
_serverTimeout = config.GetCurrentServer().timeout * 1000; | |||||
lastActivity = DateTime.Now; | lastActivity = DateTime.Now; | ||||
} | } | ||||
@@ -442,7 +445,7 @@ namespace Shadowsocks.Controller | |||||
var session = new AsyncSession(remote); | var session = new AsyncSession(remote); | ||||
_currentRemoteSession = session; | _currentRemoteSession = session; | ||||
ProxyTimer proxyTimer = new ProxyTimer(3000); | |||||
ProxyTimer proxyTimer = new ProxyTimer(_proxyTimeout); | |||||
proxyTimer.AutoReset = false; | proxyTimer.AutoReset = false; | ||||
proxyTimer.Elapsed += proxyConnectTimer_Elapsed; | proxyTimer.Elapsed += proxyConnectTimer_Elapsed; | ||||
proxyTimer.Enabled = true; | proxyTimer.Enabled = true; | ||||
@@ -515,7 +518,7 @@ namespace Shadowsocks.Controller | |||||
} | } | ||||
_startConnectTime = DateTime.Now; | _startConnectTime = DateTime.Now; | ||||
ServerTimer connectTimer = new ServerTimer(3000); | |||||
ServerTimer connectTimer = new ServerTimer(_serverTimeout); | |||||
connectTimer.AutoReset = false; | connectTimer.AutoReset = false; | ||||
connectTimer.Elapsed += destConnectTimer_Elapsed; | connectTimer.Elapsed += destConnectTimer_Elapsed; | ||||
connectTimer.Enabled = true; | connectTimer.Enabled = true; | ||||
@@ -47,6 +47,7 @@ Password=密码 | |||||
Encryption=加密 | Encryption=加密 | ||||
Proxy Port=代理端口 | Proxy Port=代理端口 | ||||
Remarks=备注 | Remarks=备注 | ||||
Timeout(Sec)=超时(秒) | |||||
Onetime Authentication=一次性认证 | Onetime Authentication=一次性认证 | ||||
OK=确定 | OK=确定 | ||||
Cancel=取消 | Cancel=取消 | ||||
@@ -132,3 +133,4 @@ Proxy request failed=代理请求失败 | |||||
Proxy handshake failed=代理握手失败 | Proxy handshake failed=代理握手失败 | ||||
Register hotkey failed=注册热键失败 | Register hotkey failed=注册热键失败 | ||||
Cannot parse hotkey: {0}=解析热键失败: {0} | Cannot parse hotkey: {0}=解析热键失败: {0} | ||||
Timeout is invalid, it should not exceed {0}=超时无效,不应超过 {0} |
@@ -47,6 +47,7 @@ Password=密碼 | |||||
Encryption=加密 | Encryption=加密 | ||||
Proxy Port=代理連接埠 | Proxy Port=代理連接埠 | ||||
Remarks=備註 | Remarks=備註 | ||||
Timeout(Sec)=超時(秒) | |||||
Onetime Authentication=單次驗證 | Onetime Authentication=單次驗證 | ||||
OK=確定 | OK=確定 | ||||
Cancel=取消 | Cancel=取消 | ||||
@@ -132,3 +133,4 @@ Proxy request failed=代理請求失敗 | |||||
Proxy handshake failed=代理握手失敗 | Proxy handshake failed=代理握手失敗 | ||||
Register hotkey failed=註冊捷徑鍵失敗 | Register hotkey failed=註冊捷徑鍵失敗 | ||||
Cannot parse hotkey: {0}=解析捷徑鍵失敗: {0} | Cannot parse hotkey: {0}=解析捷徑鍵失敗: {0} | ||||
Timeout is invalid, it should not exceed {0}=超時無效,不應超過 {0} |
@@ -44,6 +44,7 @@ namespace Shadowsocks.Model | |||||
CheckPort(server.server_port); | CheckPort(server.server_port); | ||||
CheckPassword(server.password); | CheckPassword(server.password); | ||||
CheckServer(server.server); | CheckServer(server.server); | ||||
CheckTimeout(server.timeout, Server.MaxServerTimeoutSec); | |||||
} | } | ||||
public static Configuration Load() | public static Configuration Load() | ||||
@@ -147,5 +148,12 @@ namespace Shadowsocks.Model | |||||
if (server.IsNullOrEmpty()) | if (server.IsNullOrEmpty()) | ||||
throw new ArgumentException(I18N.GetString("Server IP can not be blank")); | throw new ArgumentException(I18N.GetString("Server IP can not be blank")); | ||||
} | } | ||||
public static void CheckTimeout(int timeout, int maxTimeout) | |||||
{ | |||||
if (timeout <= 0 || timeout > maxTimeout) | |||||
throw new ArgumentException(string.Format( | |||||
I18N.GetString("Timeout is invalid, it should not exceed {0}"), maxTimeout)); | |||||
} | |||||
} | } | ||||
} | } |
@@ -8,10 +8,14 @@ namespace Shadowsocks.Model | |||||
public const int PROXY_SOCKS5 = 0; | public const int PROXY_SOCKS5 = 0; | ||||
public const int PROXY_HTTP = 1; | public const int PROXY_HTTP = 1; | ||||
public const int MaxProxyTimeoutSec = 10; | |||||
private const int DefaultProxyTimeoutSec = 3; | |||||
public bool useProxy; | public bool useProxy; | ||||
public int proxyType; | public int proxyType; | ||||
public string proxyServer; | public string proxyServer; | ||||
public int proxyPort; | public int proxyPort; | ||||
public int proxyTimeout; | |||||
public ProxyConfig() | public ProxyConfig() | ||||
{ | { | ||||
@@ -19,6 +23,7 @@ namespace Shadowsocks.Model | |||||
proxyType = PROXY_SOCKS5; | proxyType = PROXY_SOCKS5; | ||||
proxyServer = ""; | proxyServer = ""; | ||||
proxyPort = 0; | proxyPort = 0; | ||||
proxyTimeout = DefaultProxyTimeoutSec; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -15,12 +15,16 @@ namespace Shadowsocks.Model | |||||
DetailsParser = new Regex("^((?<method>.+?)(?<auth>-auth)??:(?<password>.*)@(?<hostname>.+?)" + | DetailsParser = new Regex("^((?<method>.+?)(?<auth>-auth)??:(?<password>.*)@(?<hostname>.+?)" + | ||||
":(?<port>\\d+?))$", RegexOptions.Compiled | RegexOptions.IgnoreCase); | ":(?<port>\\d+?))$", RegexOptions.Compiled | RegexOptions.IgnoreCase); | ||||
private const int DefaultServerTimeoutSec = 5; | |||||
public const int MaxServerTimeoutSec = 20; | |||||
public string server; | public string server; | ||||
public int server_port; | public int server_port; | ||||
public string password; | public string password; | ||||
public string method; | public string method; | ||||
public string remarks; | public string remarks; | ||||
public bool auth; | public bool auth; | ||||
public int timeout; | |||||
public override int GetHashCode() | public override int GetHashCode() | ||||
{ | { | ||||
@@ -67,6 +71,7 @@ namespace Shadowsocks.Model | |||||
password = ""; | password = ""; | ||||
remarks = ""; | remarks = ""; | ||||
auth = false; | auth = false; | ||||
timeout = DefaultServerTimeoutSec; | |||||
} | } | ||||
public Server(string ssURL) : this() | public Server(string ssURL) : this() | ||||
@@ -57,6 +57,8 @@ | |||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); | this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); | ||||
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); | this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); | ||||
this.DuplicateButton = new System.Windows.Forms.Button(); | this.DuplicateButton = new System.Windows.Forms.Button(); | ||||
this.TimeoutLabel = new System.Windows.Forms.Label(); | |||||
this.TimeoutTextBox = new System.Windows.Forms.TextBox(); | |||||
this.tableLayoutPanel1.SuspendLayout(); | this.tableLayoutPanel1.SuspendLayout(); | ||||
this.ServerGroupBox.SuspendLayout(); | this.ServerGroupBox.SuspendLayout(); | ||||
this.tableLayoutPanel2.SuspendLayout(); | this.tableLayoutPanel2.SuspendLayout(); | ||||
@@ -83,12 +85,14 @@ | |||||
this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 2); | this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 2); | ||||
this.tableLayoutPanel1.Controls.Add(this.EncryptionLabel, 0, 3); | this.tableLayoutPanel1.Controls.Add(this.EncryptionLabel, 0, 3); | ||||
this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 3); | this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 3); | ||||
this.tableLayoutPanel1.Controls.Add(this.OneTimeAuth, 1, 6); | |||||
this.tableLayoutPanel1.Controls.Add(this.OneTimeAuth, 1, 7); | |||||
this.tableLayoutPanel1.Controls.Add(this.TimeoutLabel, 0, 6); | |||||
this.tableLayoutPanel1.Controls.Add(this.TimeoutTextBox, 1, 6); | |||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 21); | this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 21); | ||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); | this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); | ||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | ||||
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); | this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); | ||||
this.tableLayoutPanel1.RowCount = 7; | |||||
this.tableLayoutPanel1.RowCount = 8; | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
@@ -96,13 +100,14 @@ | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(249, 162); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(255, 189); | |||||
this.tableLayoutPanel1.TabIndex = 0; | this.tableLayoutPanel1.TabIndex = 0; | ||||
// | // | ||||
// RemarksTextBox | // RemarksTextBox | ||||
// | // | ||||
this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | ||||
this.RemarksTextBox.Location = new System.Drawing.Point(83, 113); | |||||
this.RemarksTextBox.Location = new System.Drawing.Point(89, 113); | |||||
this.RemarksTextBox.MaxLength = 32; | this.RemarksTextBox.MaxLength = 32; | ||||
this.RemarksTextBox.Name = "RemarksTextBox"; | this.RemarksTextBox.Name = "RemarksTextBox"; | ||||
this.RemarksTextBox.Size = new System.Drawing.Size(160, 21); | this.RemarksTextBox.Size = new System.Drawing.Size(160, 21); | ||||
@@ -113,7 +118,7 @@ | |||||
// | // | ||||
this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | ||||
this.RemarksLabel.AutoSize = true; | this.RemarksLabel.AutoSize = true; | ||||
this.RemarksLabel.Location = new System.Drawing.Point(30, 117); | |||||
this.RemarksLabel.Location = new System.Drawing.Point(36, 117); | |||||
this.RemarksLabel.Name = "RemarksLabel"; | this.RemarksLabel.Name = "RemarksLabel"; | ||||
this.RemarksLabel.Size = new System.Drawing.Size(47, 12); | this.RemarksLabel.Size = new System.Drawing.Size(47, 12); | ||||
this.RemarksLabel.TabIndex = 9; | this.RemarksLabel.TabIndex = 9; | ||||
@@ -123,7 +128,7 @@ | |||||
// | // | ||||
this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | ||||
this.IPLabel.AutoSize = true; | this.IPLabel.AutoSize = true; | ||||
this.IPLabel.Location = new System.Drawing.Point(18, 10); | |||||
this.IPLabel.Location = new System.Drawing.Point(24, 10); | |||||
this.IPLabel.Name = "IPLabel"; | this.IPLabel.Name = "IPLabel"; | ||||
this.IPLabel.Size = new System.Drawing.Size(59, 12); | this.IPLabel.Size = new System.Drawing.Size(59, 12); | ||||
this.IPLabel.TabIndex = 0; | this.IPLabel.TabIndex = 0; | ||||
@@ -133,7 +138,7 @@ | |||||
// | // | ||||
this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | ||||
this.ServerPortLabel.AutoSize = true; | this.ServerPortLabel.AutoSize = true; | ||||
this.ServerPortLabel.Location = new System.Drawing.Point(6, 37); | |||||
this.ServerPortLabel.Location = new System.Drawing.Point(12, 37); | |||||
this.ServerPortLabel.Name = "ServerPortLabel"; | this.ServerPortLabel.Name = "ServerPortLabel"; | ||||
this.ServerPortLabel.Size = new System.Drawing.Size(71, 12); | this.ServerPortLabel.Size = new System.Drawing.Size(71, 12); | ||||
this.ServerPortLabel.TabIndex = 1; | this.ServerPortLabel.TabIndex = 1; | ||||
@@ -143,7 +148,7 @@ | |||||
// | // | ||||
this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | ||||
this.PasswordLabel.AutoSize = true; | this.PasswordLabel.AutoSize = true; | ||||
this.PasswordLabel.Location = new System.Drawing.Point(24, 64); | |||||
this.PasswordLabel.Location = new System.Drawing.Point(30, 64); | |||||
this.PasswordLabel.Name = "PasswordLabel"; | this.PasswordLabel.Name = "PasswordLabel"; | ||||
this.PasswordLabel.Size = new System.Drawing.Size(53, 12); | this.PasswordLabel.Size = new System.Drawing.Size(53, 12); | ||||
this.PasswordLabel.TabIndex = 2; | this.PasswordLabel.TabIndex = 2; | ||||
@@ -152,7 +157,7 @@ | |||||
// IPTextBox | // IPTextBox | ||||
// | // | ||||
this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | ||||
this.IPTextBox.Location = new System.Drawing.Point(83, 6); | |||||
this.IPTextBox.Location = new System.Drawing.Point(89, 6); | |||||
this.IPTextBox.MaxLength = 512; | this.IPTextBox.MaxLength = 512; | ||||
this.IPTextBox.Name = "IPTextBox"; | this.IPTextBox.Name = "IPTextBox"; | ||||
this.IPTextBox.Size = new System.Drawing.Size(160, 21); | this.IPTextBox.Size = new System.Drawing.Size(160, 21); | ||||
@@ -162,7 +167,7 @@ | |||||
// ServerPortTextBox | // ServerPortTextBox | ||||
// | // | ||||
this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | ||||
this.ServerPortTextBox.Location = new System.Drawing.Point(83, 33); | |||||
this.ServerPortTextBox.Location = new System.Drawing.Point(89, 33); | |||||
this.ServerPortTextBox.MaxLength = 10; | this.ServerPortTextBox.MaxLength = 10; | ||||
this.ServerPortTextBox.Name = "ServerPortTextBox"; | this.ServerPortTextBox.Name = "ServerPortTextBox"; | ||||
this.ServerPortTextBox.Size = new System.Drawing.Size(160, 21); | this.ServerPortTextBox.Size = new System.Drawing.Size(160, 21); | ||||
@@ -172,7 +177,7 @@ | |||||
// PasswordTextBox | // PasswordTextBox | ||||
// | // | ||||
this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | ||||
this.PasswordTextBox.Location = new System.Drawing.Point(83, 60); | |||||
this.PasswordTextBox.Location = new System.Drawing.Point(89, 60); | |||||
this.PasswordTextBox.MaxLength = 256; | this.PasswordTextBox.MaxLength = 256; | ||||
this.PasswordTextBox.Name = "PasswordTextBox"; | this.PasswordTextBox.Name = "PasswordTextBox"; | ||||
this.PasswordTextBox.Size = new System.Drawing.Size(160, 21); | this.PasswordTextBox.Size = new System.Drawing.Size(160, 21); | ||||
@@ -184,7 +189,7 @@ | |||||
// | // | ||||
this.EncryptionLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | this.EncryptionLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | ||||
this.EncryptionLabel.AutoSize = true; | this.EncryptionLabel.AutoSize = true; | ||||
this.EncryptionLabel.Location = new System.Drawing.Point(12, 91); | |||||
this.EncryptionLabel.Location = new System.Drawing.Point(18, 91); | |||||
this.EncryptionLabel.Name = "EncryptionLabel"; | this.EncryptionLabel.Name = "EncryptionLabel"; | ||||
this.EncryptionLabel.Size = new System.Drawing.Size(65, 12); | this.EncryptionLabel.Size = new System.Drawing.Size(65, 12); | ||||
this.EncryptionLabel.TabIndex = 8; | this.EncryptionLabel.TabIndex = 8; | ||||
@@ -213,7 +218,7 @@ | |||||
"camellia-128-cfb", | "camellia-128-cfb", | ||||
"camellia-192-cfb", | "camellia-192-cfb", | ||||
"camellia-256-cfb"}); | "camellia-256-cfb"}); | ||||
this.EncryptionSelect.Location = new System.Drawing.Point(83, 87); | |||||
this.EncryptionSelect.Location = new System.Drawing.Point(89, 87); | |||||
this.EncryptionSelect.Name = "EncryptionSelect"; | this.EncryptionSelect.Name = "EncryptionSelect"; | ||||
this.EncryptionSelect.Size = new System.Drawing.Size(160, 20); | this.EncryptionSelect.Size = new System.Drawing.Size(160, 20); | ||||
this.EncryptionSelect.TabIndex = 3; | this.EncryptionSelect.TabIndex = 3; | ||||
@@ -221,7 +226,7 @@ | |||||
// OneTimeAuth | // OneTimeAuth | ||||
// | // | ||||
this.OneTimeAuth.AutoSize = true; | this.OneTimeAuth.AutoSize = true; | ||||
this.OneTimeAuth.Location = new System.Drawing.Point(83, 140); | |||||
this.OneTimeAuth.Location = new System.Drawing.Point(89, 167); | |||||
this.OneTimeAuth.Name = "OneTimeAuth"; | this.OneTimeAuth.Name = "OneTimeAuth"; | ||||
this.OneTimeAuth.Size = new System.Drawing.Size(156, 16); | this.OneTimeAuth.Size = new System.Drawing.Size(156, 16); | ||||
this.OneTimeAuth.TabIndex = 5; | this.OneTimeAuth.TabIndex = 5; | ||||
@@ -296,7 +301,7 @@ | |||||
this.ServerGroupBox.Location = new System.Drawing.Point(178, 0); | this.ServerGroupBox.Location = new System.Drawing.Point(178, 0); | ||||
this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); | this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); | ||||
this.ServerGroupBox.Name = "ServerGroupBox"; | this.ServerGroupBox.Name = "ServerGroupBox"; | ||||
this.ServerGroupBox.Size = new System.Drawing.Size(260, 200); | |||||
this.ServerGroupBox.Size = new System.Drawing.Size(266, 227); | |||||
this.ServerGroupBox.TabIndex = 0; | this.ServerGroupBox.TabIndex = 0; | ||||
this.ServerGroupBox.TabStop = false; | this.ServerGroupBox.TabStop = false; | ||||
this.ServerGroupBox.Text = "Server"; | this.ServerGroupBox.Text = "Server"; | ||||
@@ -333,7 +338,7 @@ | |||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(438, 296); | |||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(444, 323); | |||||
this.tableLayoutPanel2.TabIndex = 7; | this.tableLayoutPanel2.TabIndex = 7; | ||||
// | // | ||||
// tableLayoutPanel6 | // tableLayoutPanel6 | ||||
@@ -346,7 +351,7 @@ | |||||
this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); | this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); | ||||
this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); | this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); | ||||
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; | this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; | ||||
this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 264); | |||||
this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 291); | |||||
this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); | this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); | ||||
this.tableLayoutPanel6.Name = "tableLayoutPanel6"; | this.tableLayoutPanel6.Name = "tableLayoutPanel6"; | ||||
this.tableLayoutPanel6.RowCount = 1; | this.tableLayoutPanel6.RowCount = 1; | ||||
@@ -389,16 +394,16 @@ | |||||
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | ||||
this.tableLayoutPanel5.Controls.Add(this.ProxyPortTextBox, 1, 0); | this.tableLayoutPanel5.Controls.Add(this.ProxyPortTextBox, 1, 0); | ||||
this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0); | this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0); | ||||
this.tableLayoutPanel5.Location = new System.Drawing.Point(242, 200); | |||||
this.tableLayoutPanel5.Location = new System.Drawing.Point(248, 227); | |||||
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); | this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); | ||||
this.tableLayoutPanel5.Name = "tableLayoutPanel5"; | this.tableLayoutPanel5.Name = "tableLayoutPanel5"; | ||||
this.tableLayoutPanel5.Padding = new System.Windows.Forms.Padding(3); | this.tableLayoutPanel5.Padding = new System.Windows.Forms.Padding(3); | ||||
this.tableLayoutPanel5.RowCount = 1; | this.tableLayoutPanel5.RowCount = 1; | ||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); | this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); | ||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); | |||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); | |||||
this.tableLayoutPanel5.Size = new System.Drawing.Size(196, 64); | this.tableLayoutPanel5.Size = new System.Drawing.Size(196, 64); | ||||
this.tableLayoutPanel5.TabIndex = 9; | this.tableLayoutPanel5.TabIndex = 9; | ||||
// | // | ||||
@@ -433,7 +438,7 @@ | |||||
this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); | this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); | ||||
this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); | this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); | ||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; | this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; | ||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(279, 267); | |||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(285, 294); | |||||
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); | this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); | ||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; | this.tableLayoutPanel3.Name = "tableLayoutPanel3"; | ||||
this.tableLayoutPanel3.RowCount = 1; | this.tableLayoutPanel3.RowCount = 1; | ||||
@@ -452,7 +457,7 @@ | |||||
this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); | this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); | ||||
this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); | this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); | ||||
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; | this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; | ||||
this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 200); | |||||
this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 227); | |||||
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); | this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); | ||||
this.tableLayoutPanel4.Name = "tableLayoutPanel4"; | this.tableLayoutPanel4.Name = "tableLayoutPanel4"; | ||||
this.tableLayoutPanel4.RowCount = 2; | this.tableLayoutPanel4.RowCount = 2; | ||||
@@ -473,6 +478,26 @@ | |||||
this.DuplicateButton.UseVisualStyleBackColor = true; | this.DuplicateButton.UseVisualStyleBackColor = true; | ||||
this.DuplicateButton.Click += new System.EventHandler(this.DuplicateButton_Click); | this.DuplicateButton.Click += new System.EventHandler(this.DuplicateButton_Click); | ||||
// | // | ||||
// TimeoutLabel | |||||
// | |||||
this.TimeoutLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; | |||||
this.TimeoutLabel.AutoSize = true; | |||||
this.TimeoutLabel.Location = new System.Drawing.Point(6, 144); | |||||
this.TimeoutLabel.Name = "TimeoutLabel"; | |||||
this.TimeoutLabel.RightToLeft = System.Windows.Forms.RightToLeft.No; | |||||
this.TimeoutLabel.Size = new System.Drawing.Size(77, 12); | |||||
this.TimeoutLabel.TabIndex = 10; | |||||
this.TimeoutLabel.Text = "Timeout(Sec)"; | |||||
// | |||||
// TimeoutTextBox | |||||
// | |||||
this.TimeoutTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.TimeoutTextBox.Location = new System.Drawing.Point(89, 140); | |||||
this.TimeoutTextBox.MaxLength = 5; | |||||
this.TimeoutTextBox.Name = "TimeoutTextBox"; | |||||
this.TimeoutTextBox.Size = new System.Drawing.Size(160, 21); | |||||
this.TimeoutTextBox.TabIndex = 11; | |||||
// | |||||
// ConfigForm | // ConfigForm | ||||
// | // | ||||
this.AcceptButton = this.OKButton; | this.AcceptButton = this.OKButton; | ||||
@@ -542,6 +567,8 @@ | |||||
private System.Windows.Forms.Button MoveUpButton; | private System.Windows.Forms.Button MoveUpButton; | ||||
private System.Windows.Forms.CheckBox OneTimeAuth; | private System.Windows.Forms.CheckBox OneTimeAuth; | ||||
private System.Windows.Forms.Button DuplicateButton; | private System.Windows.Forms.Button DuplicateButton; | ||||
private System.Windows.Forms.Label TimeoutLabel; | |||||
private System.Windows.Forms.TextBox TimeoutTextBox; | |||||
} | } | ||||
} | } | ||||
@@ -49,6 +49,7 @@ namespace Shadowsocks.View | |||||
EncryptionLabel.Text = I18N.GetString("Encryption"); | EncryptionLabel.Text = I18N.GetString("Encryption"); | ||||
ProxyPortLabel.Text = I18N.GetString("Proxy Port"); | ProxyPortLabel.Text = I18N.GetString("Proxy Port"); | ||||
RemarksLabel.Text = I18N.GetString("Remarks"); | RemarksLabel.Text = I18N.GetString("Remarks"); | ||||
TimeoutLabel.Text = I18N.GetString("Timeout(Sec)"); | |||||
OneTimeAuth.Text = I18N.GetString("Onetime Authentication"); | OneTimeAuth.Text = I18N.GetString("Onetime Authentication"); | ||||
ServerGroupBox.Text = I18N.GetString("Server"); | ServerGroupBox.Text = I18N.GetString("Server"); | ||||
OKButton.Text = I18N.GetString("OK"); | OKButton.Text = I18N.GetString("OK"); | ||||
@@ -85,6 +86,7 @@ namespace Shadowsocks.View | |||||
password = PasswordTextBox.Text, | password = PasswordTextBox.Text, | ||||
method = EncryptionSelect.Text, | method = EncryptionSelect.Text, | ||||
remarks = RemarksTextBox.Text, | remarks = RemarksTextBox.Text, | ||||
timeout = int.Parse(TimeoutTextBox.Text), | |||||
auth = OneTimeAuth.Checked | auth = OneTimeAuth.Checked | ||||
}; | }; | ||||
int localPort = int.Parse(ProxyPortTextBox.Text); | int localPort = int.Parse(ProxyPortTextBox.Text); | ||||
@@ -118,6 +120,7 @@ namespace Shadowsocks.View | |||||
ProxyPortTextBox.Text = _modifiedConfiguration.localPort.ToString(); | ProxyPortTextBox.Text = _modifiedConfiguration.localPort.ToString(); | ||||
EncryptionSelect.Text = server.method ?? "aes-256-cfb"; | EncryptionSelect.Text = server.method ?? "aes-256-cfb"; | ||||
RemarksTextBox.Text = server.remarks; | RemarksTextBox.Text = server.remarks; | ||||
TimeoutTextBox.Text = server.timeout.ToString(); | |||||
OneTimeAuth.Checked = server.auth; | OneTimeAuth.Checked = server.auth; | ||||
} | } | ||||
} | } | ||||
@@ -28,226 +28,252 @@ | |||||
/// </summary> | /// </summary> | ||||
private void InitializeComponent() | private void InitializeComponent() | ||||
{ | { | ||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.MyCancelButton = new System.Windows.Forms.Button(); | |||||
this.OKButton = new System.Windows.Forms.Button(); | |||||
this.UseProxyCheckBox = new System.Windows.Forms.CheckBox(); | |||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.ProxyAddrLabel = new System.Windows.Forms.Label(); | |||||
this.ProxyServerTextBox = new System.Windows.Forms.TextBox(); | |||||
this.ProxyPortLable = new System.Windows.Forms.Label(); | |||||
this.ProxyPortTextBox = new System.Windows.Forms.TextBox(); | |||||
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.ProxyTypeLabel = new System.Windows.Forms.Label(); | |||||
this.ProxyTypeComboBox = new System.Windows.Forms.ComboBox(); | |||||
this.tableLayoutPanel1.SuspendLayout(); | |||||
this.tableLayoutPanel3.SuspendLayout(); | |||||
this.tableLayoutPanel2.SuspendLayout(); | |||||
this.tableLayoutPanel4.SuspendLayout(); | |||||
this.SuspendLayout(); | |||||
// | |||||
// tableLayoutPanel1 | |||||
// | |||||
this.tableLayoutPanel1.AutoSize = true; | |||||
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.tableLayoutPanel1.ColumnCount = 1; | |||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 3); | |||||
this.tableLayoutPanel1.Controls.Add(this.UseProxyCheckBox, 0, 0); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 2); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel4, 0, 1); | |||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(15, 15); | |||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | |||||
this.tableLayoutPanel1.RowCount = 4; | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(395, 123); | |||||
this.tableLayoutPanel1.TabIndex = 0; | |||||
// | |||||
// tableLayoutPanel3 | |||||
// | |||||
this.tableLayoutPanel3.AutoSize = true; | |||||
this.tableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.tableLayoutPanel3.ColumnCount = 2; | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); | |||||
this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); | |||||
this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); | |||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(236, 94); | |||||
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); | |||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; | |||||
this.tableLayoutPanel3.RowCount = 1; | |||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel3.Size = new System.Drawing.Size(159, 26); | |||||
this.tableLayoutPanel3.TabIndex = 9; | |||||
// | |||||
// MyCancelButton | |||||
// | |||||
this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; | |||||
this.MyCancelButton.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.MyCancelButton.Location = new System.Drawing.Point(84, 3); | |||||
this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); | |||||
this.MyCancelButton.Name = "MyCancelButton"; | |||||
this.MyCancelButton.Size = new System.Drawing.Size(75, 23); | |||||
this.MyCancelButton.TabIndex = 13; | |||||
this.MyCancelButton.Text = "Cancel"; | |||||
this.MyCancelButton.UseVisualStyleBackColor = true; | |||||
this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); | |||||
// | |||||
// OKButton | |||||
// | |||||
this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK; | |||||
this.OKButton.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.OKButton.Location = new System.Drawing.Point(3, 3); | |||||
this.OKButton.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); | |||||
this.OKButton.Name = "OKButton"; | |||||
this.OKButton.Size = new System.Drawing.Size(75, 23); | |||||
this.OKButton.TabIndex = 12; | |||||
this.OKButton.Text = "OK"; | |||||
this.OKButton.UseVisualStyleBackColor = true; | |||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click); | |||||
// | |||||
// UseProxyCheckBox | |||||
// | |||||
this.UseProxyCheckBox.AutoSize = true; | |||||
this.UseProxyCheckBox.Location = new System.Drawing.Point(3, 3); | |||||
this.UseProxyCheckBox.Name = "UseProxyCheckBox"; | |||||
this.UseProxyCheckBox.Size = new System.Drawing.Size(78, 16); | |||||
this.UseProxyCheckBox.TabIndex = 0; | |||||
this.UseProxyCheckBox.Text = "Use Proxy"; | |||||
this.UseProxyCheckBox.UseVisualStyleBackColor = true; | |||||
this.UseProxyCheckBox.CheckedChanged += new System.EventHandler(this.UseProxyCheckBox_CheckedChanged); | |||||
// | |||||
// tableLayoutPanel2 | |||||
// | |||||
this.tableLayoutPanel2.AutoSize = true; | |||||
this.tableLayoutPanel2.ColumnCount = 4; | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyAddrLabel, 0, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyServerTextBox, 1, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyPortLable, 2, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyPortTextBox, 3, 0); | |||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 61); | |||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; | |||||
this.tableLayoutPanel2.RowCount = 1; | |||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); | |||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); | |||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(389, 27); | |||||
this.tableLayoutPanel2.TabIndex = 1; | |||||
// | |||||
// ProxyAddrLabel | |||||
// | |||||
this.ProxyAddrLabel.Anchor = System.Windows.Forms.AnchorStyles.Left; | |||||
this.ProxyAddrLabel.AutoSize = true; | |||||
this.ProxyAddrLabel.Location = new System.Drawing.Point(3, 7); | |||||
this.ProxyAddrLabel.Name = "ProxyAddrLabel"; | |||||
this.ProxyAddrLabel.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyAddrLabel.TabIndex = 0; | |||||
this.ProxyAddrLabel.Text = "Proxy Addr"; | |||||
// | |||||
// ProxyServerTextBox | |||||
// | |||||
this.ProxyServerTextBox.Location = new System.Drawing.Point(74, 3); | |||||
this.ProxyServerTextBox.MaxLength = 512; | |||||
this.ProxyServerTextBox.Name = "ProxyServerTextBox"; | |||||
this.ProxyServerTextBox.Size = new System.Drawing.Size(135, 21); | |||||
this.ProxyServerTextBox.TabIndex = 1; | |||||
this.ProxyServerTextBox.WordWrap = false; | |||||
// | |||||
// ProxyPortLable | |||||
// | |||||
this.ProxyPortLable.Anchor = System.Windows.Forms.AnchorStyles.Left; | |||||
this.ProxyPortLable.AutoSize = true; | |||||
this.ProxyPortLable.Location = new System.Drawing.Point(215, 7); | |||||
this.ProxyPortLable.Name = "ProxyPortLable"; | |||||
this.ProxyPortLable.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyPortLable.TabIndex = 2; | |||||
this.ProxyPortLable.Text = "Proxy Port"; | |||||
// | |||||
// ProxyPortTextBox | |||||
// | |||||
this.ProxyPortTextBox.Location = new System.Drawing.Point(286, 3); | |||||
this.ProxyPortTextBox.MaxLength = 10; | |||||
this.ProxyPortTextBox.Name = "ProxyPortTextBox"; | |||||
this.ProxyPortTextBox.Size = new System.Drawing.Size(100, 21); | |||||
this.ProxyPortTextBox.TabIndex = 3; | |||||
this.ProxyPortTextBox.WordWrap = false; | |||||
// | |||||
// tableLayoutPanel4 | |||||
// | |||||
this.tableLayoutPanel4.AutoSize = true; | |||||
this.tableLayoutPanel4.ColumnCount = 2; | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTypeLabel, 0, 0); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTypeComboBox, 1, 0); | |||||
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 25); | |||||
this.tableLayoutPanel4.Name = "tableLayoutPanel4"; | |||||
this.tableLayoutPanel4.RowCount = 1; | |||||
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel4.Size = new System.Drawing.Size(198, 30); | |||||
this.tableLayoutPanel4.TabIndex = 10; | |||||
// | |||||
// ProxyTypeLabel | |||||
// | |||||
this.ProxyTypeLabel.Anchor = System.Windows.Forms.AnchorStyles.Left; | |||||
this.ProxyTypeLabel.AutoSize = true; | |||||
this.ProxyTypeLabel.Location = new System.Drawing.Point(3, 9); | |||||
this.ProxyTypeLabel.Name = "ProxyTypeLabel"; | |||||
this.ProxyTypeLabel.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyTypeLabel.TabIndex = 1; | |||||
this.ProxyTypeLabel.Text = "Proxy Type"; | |||||
// | |||||
// ProxyTypeComboBox | |||||
// | |||||
this.ProxyTypeComboBox.Dock = System.Windows.Forms.DockStyle.Fill; | |||||
this.ProxyTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; | |||||
this.ProxyTypeComboBox.FormattingEnabled = true; | |||||
this.ProxyTypeComboBox.Items.AddRange(new object[] { | |||||
"SOCKS5", | |||||
"HTTP"}); | |||||
this.ProxyTypeComboBox.Location = new System.Drawing.Point(74, 5); | |||||
this.ProxyTypeComboBox.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); | |||||
this.ProxyTypeComboBox.Name = "ProxyTypeComboBox"; | |||||
this.ProxyTypeComboBox.Size = new System.Drawing.Size(121, 20); | |||||
this.ProxyTypeComboBox.TabIndex = 2; | |||||
// | |||||
// ProxyForm | |||||
// | |||||
this.AcceptButton = this.OKButton; | |||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); | |||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; | |||||
this.AutoSize = true; | |||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.CancelButton = this.MyCancelButton; | |||||
this.ClientSize = new System.Drawing.Size(441, 165); | |||||
this.Controls.Add(this.tableLayoutPanel1); | |||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; | |||||
this.MaximizeBox = false; | |||||
this.MinimizeBox = false; | |||||
this.Name = "ProxyForm"; | |||||
this.Padding = new System.Windows.Forms.Padding(12, 12, 12, 9); | |||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||||
this.Text = "Edit Proxy"; | |||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ProxyForm_FormClosed); | |||||
this.tableLayoutPanel1.ResumeLayout(false); | |||||
this.tableLayoutPanel1.PerformLayout(); | |||||
this.tableLayoutPanel3.ResumeLayout(false); | |||||
this.tableLayoutPanel2.ResumeLayout(false); | |||||
this.tableLayoutPanel2.PerformLayout(); | |||||
this.tableLayoutPanel4.ResumeLayout(false); | |||||
this.tableLayoutPanel4.PerformLayout(); | |||||
this.ResumeLayout(false); | |||||
this.PerformLayout(); | |||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.MyCancelButton = new System.Windows.Forms.Button(); | |||||
this.OKButton = new System.Windows.Forms.Button(); | |||||
this.UseProxyCheckBox = new System.Windows.Forms.CheckBox(); | |||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.ProxyAddrLabel = new System.Windows.Forms.Label(); | |||||
this.ProxyServerTextBox = new System.Windows.Forms.TextBox(); | |||||
this.ProxyPortLabel = new System.Windows.Forms.Label(); | |||||
this.ProxyPortTextBox = new System.Windows.Forms.TextBox(); | |||||
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); | |||||
this.ProxyTypeLabel = new System.Windows.Forms.Label(); | |||||
this.ProxyTypeComboBox = new System.Windows.Forms.ComboBox(); | |||||
this.ProxyTimeoutTextBox = new System.Windows.Forms.TextBox(); | |||||
this.ProxyTimeoutLabel = new System.Windows.Forms.Label(); | |||||
this.tableLayoutPanel1.SuspendLayout(); | |||||
this.tableLayoutPanel3.SuspendLayout(); | |||||
this.tableLayoutPanel2.SuspendLayout(); | |||||
this.tableLayoutPanel4.SuspendLayout(); | |||||
this.SuspendLayout(); | |||||
// | |||||
// tableLayoutPanel1 | |||||
// | |||||
this.tableLayoutPanel1.AutoSize = true; | |||||
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.tableLayoutPanel1.ColumnCount = 1; | |||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 3); | |||||
this.tableLayoutPanel1.Controls.Add(this.UseProxyCheckBox, 0, 0); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 2); | |||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel4, 0, 1); | |||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(15, 15); | |||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; | |||||
this.tableLayoutPanel1.RowCount = 4; | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(395, 123); | |||||
this.tableLayoutPanel1.TabIndex = 0; | |||||
// | |||||
// tableLayoutPanel3 | |||||
// | |||||
this.tableLayoutPanel3.AutoSize = true; | |||||
this.tableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.tableLayoutPanel3.ColumnCount = 2; | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); | |||||
this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); | |||||
this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); | |||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(236, 94); | |||||
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); | |||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; | |||||
this.tableLayoutPanel3.RowCount = 1; | |||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel3.Size = new System.Drawing.Size(159, 26); | |||||
this.tableLayoutPanel3.TabIndex = 9; | |||||
// | |||||
// MyCancelButton | |||||
// | |||||
this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; | |||||
this.MyCancelButton.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.MyCancelButton.Location = new System.Drawing.Point(84, 3); | |||||
this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); | |||||
this.MyCancelButton.Name = "MyCancelButton"; | |||||
this.MyCancelButton.Size = new System.Drawing.Size(75, 23); | |||||
this.MyCancelButton.TabIndex = 13; | |||||
this.MyCancelButton.Text = "Cancel"; | |||||
this.MyCancelButton.UseVisualStyleBackColor = true; | |||||
this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); | |||||
// | |||||
// OKButton | |||||
// | |||||
this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK; | |||||
this.OKButton.Dock = System.Windows.Forms.DockStyle.Right; | |||||
this.OKButton.Location = new System.Drawing.Point(3, 3); | |||||
this.OKButton.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); | |||||
this.OKButton.Name = "OKButton"; | |||||
this.OKButton.Size = new System.Drawing.Size(75, 23); | |||||
this.OKButton.TabIndex = 12; | |||||
this.OKButton.Text = "OK"; | |||||
this.OKButton.UseVisualStyleBackColor = true; | |||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click); | |||||
// | |||||
// UseProxyCheckBox | |||||
// | |||||
this.UseProxyCheckBox.AutoSize = true; | |||||
this.UseProxyCheckBox.Location = new System.Drawing.Point(3, 3); | |||||
this.UseProxyCheckBox.Name = "UseProxyCheckBox"; | |||||
this.UseProxyCheckBox.Size = new System.Drawing.Size(78, 16); | |||||
this.UseProxyCheckBox.TabIndex = 0; | |||||
this.UseProxyCheckBox.Text = "Use Proxy"; | |||||
this.UseProxyCheckBox.UseVisualStyleBackColor = true; | |||||
this.UseProxyCheckBox.CheckedChanged += new System.EventHandler(this.UseProxyCheckBox_CheckedChanged); | |||||
// | |||||
// tableLayoutPanel2 | |||||
// | |||||
this.tableLayoutPanel2.AutoSize = true; | |||||
this.tableLayoutPanel2.ColumnCount = 4; | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyAddrLabel, 0, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyServerTextBox, 1, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyPortLabel, 2, 0); | |||||
this.tableLayoutPanel2.Controls.Add(this.ProxyPortTextBox, 3, 0); | |||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 61); | |||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; | |||||
this.tableLayoutPanel2.RowCount = 1; | |||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); | |||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); | |||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(389, 27); | |||||
this.tableLayoutPanel2.TabIndex = 1; | |||||
// | |||||
// ProxyAddrLabel | |||||
// | |||||
this.ProxyAddrLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyAddrLabel.AutoSize = true; | |||||
this.ProxyAddrLabel.Location = new System.Drawing.Point(3, 7); | |||||
this.ProxyAddrLabel.Name = "ProxyAddrLabel"; | |||||
this.ProxyAddrLabel.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyAddrLabel.TabIndex = 0; | |||||
this.ProxyAddrLabel.Text = "Proxy Addr"; | |||||
// | |||||
// ProxyServerTextBox | |||||
// | |||||
this.ProxyServerTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyServerTextBox.Location = new System.Drawing.Point(74, 3); | |||||
this.ProxyServerTextBox.MaxLength = 512; | |||||
this.ProxyServerTextBox.Name = "ProxyServerTextBox"; | |||||
this.ProxyServerTextBox.Size = new System.Drawing.Size(135, 21); | |||||
this.ProxyServerTextBox.TabIndex = 1; | |||||
this.ProxyServerTextBox.WordWrap = false; | |||||
// | |||||
// ProxyPortLabel | |||||
// | |||||
this.ProxyPortLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyPortLabel.AutoSize = true; | |||||
this.ProxyPortLabel.Location = new System.Drawing.Point(215, 7); | |||||
this.ProxyPortLabel.Name = "ProxyPortLabel"; | |||||
this.ProxyPortLabel.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyPortLabel.TabIndex = 2; | |||||
this.ProxyPortLabel.Text = "Proxy Port"; | |||||
// | |||||
// ProxyPortTextBox | |||||
// | |||||
this.ProxyPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyPortTextBox.Location = new System.Drawing.Point(286, 3); | |||||
this.ProxyPortTextBox.MaxLength = 10; | |||||
this.ProxyPortTextBox.Name = "ProxyPortTextBox"; | |||||
this.ProxyPortTextBox.Size = new System.Drawing.Size(100, 21); | |||||
this.ProxyPortTextBox.TabIndex = 3; | |||||
this.ProxyPortTextBox.WordWrap = false; | |||||
// | |||||
// tableLayoutPanel4 | |||||
// | |||||
this.tableLayoutPanel4.AutoSize = true; | |||||
this.tableLayoutPanel4.ColumnCount = 4; | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTypeLabel, 0, 0); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTypeComboBox, 1, 0); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTimeoutTextBox, 3, 0); | |||||
this.tableLayoutPanel4.Controls.Add(this.ProxyTimeoutLabel, 2, 0); | |||||
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 25); | |||||
this.tableLayoutPanel4.Name = "tableLayoutPanel4"; | |||||
this.tableLayoutPanel4.RowCount = 1; | |||||
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); | |||||
this.tableLayoutPanel4.Size = new System.Drawing.Size(387, 30); | |||||
this.tableLayoutPanel4.TabIndex = 10; | |||||
// | |||||
// ProxyTypeLabel | |||||
// | |||||
this.ProxyTypeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyTypeLabel.AutoSize = true; | |||||
this.ProxyTypeLabel.Location = new System.Drawing.Point(3, 9); | |||||
this.ProxyTypeLabel.Name = "ProxyTypeLabel"; | |||||
this.ProxyTypeLabel.Size = new System.Drawing.Size(65, 12); | |||||
this.ProxyTypeLabel.TabIndex = 1; | |||||
this.ProxyTypeLabel.Text = "Proxy Type"; | |||||
// | |||||
// ProxyTypeComboBox | |||||
// | |||||
this.ProxyTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; | |||||
this.ProxyTypeComboBox.FormattingEnabled = true; | |||||
this.ProxyTypeComboBox.Items.AddRange(new object[] { | |||||
"SOCKS5", | |||||
"HTTP"}); | |||||
this.ProxyTypeComboBox.Location = new System.Drawing.Point(74, 5); | |||||
this.ProxyTypeComboBox.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); | |||||
this.ProxyTypeComboBox.Name = "ProxyTypeComboBox"; | |||||
this.ProxyTypeComboBox.Size = new System.Drawing.Size(121, 20); | |||||
this.ProxyTypeComboBox.TabIndex = 2; | |||||
// | |||||
// ProxyTimeoutTextBox | |||||
// | |||||
this.ProxyTimeoutTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyTimeoutTextBox.Location = new System.Drawing.Point(284, 4); | |||||
this.ProxyTimeoutTextBox.Name = "ProxyTimeoutTextBox"; | |||||
this.ProxyTimeoutTextBox.Size = new System.Drawing.Size(100, 21); | |||||
this.ProxyTimeoutTextBox.TabIndex = 3; | |||||
// | |||||
// ProxyTimeoutLabel | |||||
// | |||||
this.ProxyTimeoutLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); | |||||
this.ProxyTimeoutLabel.AutoSize = true; | |||||
this.ProxyTimeoutLabel.Location = new System.Drawing.Point(201, 9); | |||||
this.ProxyTimeoutLabel.Name = "ProxyTimeoutLabel"; | |||||
this.ProxyTimeoutLabel.Size = new System.Drawing.Size(77, 12); | |||||
this.ProxyTimeoutLabel.TabIndex = 4; | |||||
this.ProxyTimeoutLabel.Text = "Timeout(Sec)"; | |||||
// | |||||
// ProxyForm | |||||
// | |||||
this.AcceptButton = this.OKButton; | |||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); | |||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; | |||||
this.AutoSize = true; | |||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; | |||||
this.CancelButton = this.MyCancelButton; | |||||
this.ClientSize = new System.Drawing.Size(441, 165); | |||||
this.Controls.Add(this.tableLayoutPanel1); | |||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; | |||||
this.MaximizeBox = false; | |||||
this.MinimizeBox = false; | |||||
this.Name = "ProxyForm"; | |||||
this.Padding = new System.Windows.Forms.Padding(12, 12, 12, 9); | |||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||||
this.Text = "Edit Proxy"; | |||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ProxyForm_FormClosed); | |||||
this.tableLayoutPanel1.ResumeLayout(false); | |||||
this.tableLayoutPanel1.PerformLayout(); | |||||
this.tableLayoutPanel3.ResumeLayout(false); | |||||
this.tableLayoutPanel2.ResumeLayout(false); | |||||
this.tableLayoutPanel2.PerformLayout(); | |||||
this.tableLayoutPanel4.ResumeLayout(false); | |||||
this.tableLayoutPanel4.PerformLayout(); | |||||
this.ResumeLayout(false); | |||||
this.PerformLayout(); | |||||
} | } | ||||
#endregion | #endregion | ||||
@@ -257,13 +283,15 @@ | |||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; | ||||
private System.Windows.Forms.Label ProxyAddrLabel; | private System.Windows.Forms.Label ProxyAddrLabel; | ||||
private System.Windows.Forms.TextBox ProxyServerTextBox; | private System.Windows.Forms.TextBox ProxyServerTextBox; | ||||
private System.Windows.Forms.Label ProxyPortLable; | |||||
private System.Windows.Forms.Label ProxyPortLabel; | |||||
private System.Windows.Forms.TextBox ProxyPortTextBox; | private System.Windows.Forms.TextBox ProxyPortTextBox; | ||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; | ||||
private System.Windows.Forms.Button MyCancelButton; | private System.Windows.Forms.Button MyCancelButton; | ||||
private System.Windows.Forms.Button OKButton; | private System.Windows.Forms.Button OKButton; | ||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; | ||||
private System.Windows.Forms.Label ProxyTypeLabel; | private System.Windows.Forms.Label ProxyTypeLabel; | ||||
private System.Windows.Forms.ComboBox ProxyTypeComboBox; | |||||
private System.Windows.Forms.ComboBox ProxyTypeComboBox; | |||||
private System.Windows.Forms.TextBox ProxyTimeoutTextBox; | |||||
private System.Windows.Forms.Label ProxyTimeoutLabel; | |||||
} | } | ||||
} | } |
@@ -34,7 +34,8 @@ namespace Shadowsocks.View | |||||
UseProxyCheckBox.Text = I18N.GetString("Use Proxy"); | UseProxyCheckBox.Text = I18N.GetString("Use Proxy"); | ||||
ProxyTypeLabel.Text = I18N.GetString("Proxy Type"); | ProxyTypeLabel.Text = I18N.GetString("Proxy Type"); | ||||
ProxyAddrLabel.Text = I18N.GetString("Proxy Addr"); | ProxyAddrLabel.Text = I18N.GetString("Proxy Addr"); | ||||
ProxyPortLable.Text = I18N.GetString("Proxy Port"); | |||||
ProxyPortLabel.Text = I18N.GetString("Proxy Port"); | |||||
ProxyTimeoutLabel.Text = I18N.GetString("Timeout(Sec)"); | |||||
OKButton.Text = I18N.GetString("OK"); | OKButton.Text = I18N.GetString("OK"); | ||||
MyCancelButton.Text = I18N.GetString("Cancel"); | MyCancelButton.Text = I18N.GetString("Cancel"); | ||||
this.Text = I18N.GetString("Edit Proxy"); | this.Text = I18N.GetString("Edit Proxy"); | ||||
@@ -51,6 +52,7 @@ namespace Shadowsocks.View | |||||
UseProxyCheckBox.Checked = _modifiedConfiguration.useProxy; | UseProxyCheckBox.Checked = _modifiedConfiguration.useProxy; | ||||
ProxyServerTextBox.Text = _modifiedConfiguration.proxyServer; | ProxyServerTextBox.Text = _modifiedConfiguration.proxyServer; | ||||
ProxyPortTextBox.Text = _modifiedConfiguration.proxyPort.ToString(); | ProxyPortTextBox.Text = _modifiedConfiguration.proxyPort.ToString(); | ||||
ProxyTimeoutTextBox.Text = _modifiedConfiguration.proxyTimeout.ToString(); | |||||
ProxyTypeComboBox.SelectedIndex = _modifiedConfiguration.proxyType; | ProxyTypeComboBox.SelectedIndex = _modifiedConfiguration.proxyType; | ||||
} | } | ||||
@@ -63,8 +65,10 @@ namespace Shadowsocks.View | |||||
var type = ProxyTypeComboBox.SelectedIndex; | var type = ProxyTypeComboBox.SelectedIndex; | ||||
var proxy = ProxyServerTextBox.Text; | var proxy = ProxyServerTextBox.Text; | ||||
var port = int.Parse(ProxyPortTextBox.Text); | var port = int.Parse(ProxyPortTextBox.Text); | ||||
var timeout = int.Parse(ProxyTimeoutTextBox.Text); | |||||
Configuration.CheckServer(proxy); | Configuration.CheckServer(proxy); | ||||
Configuration.CheckPort(port); | Configuration.CheckPort(port); | ||||
Configuration.CheckTimeout(timeout, ProxyConfig.MaxProxyTimeoutSec); | |||||
controller.EnableProxy(type, proxy, port); | controller.EnableProxy(type, proxy, port); | ||||
} | } | ||||
@@ -90,6 +94,9 @@ namespace Shadowsocks.View | |||||
var tmpProxyPort = 0; | var tmpProxyPort = 0; | ||||
int.TryParse(ProxyPortTextBox.Text, out tmpProxyPort); | int.TryParse(ProxyPortTextBox.Text, out tmpProxyPort); | ||||
_modifiedConfiguration.proxyPort = tmpProxyPort; | _modifiedConfiguration.proxyPort = tmpProxyPort; | ||||
var tmpProxyTimeout = 0; | |||||
int.TryParse(ProxyTimeoutTextBox.Text, out tmpProxyTimeout); | |||||
_modifiedConfiguration.proxyTimeout = tmpProxyTimeout; | |||||
controller.SaveProxyConfig(_modifiedConfiguration); | controller.SaveProxyConfig(_modifiedConfiguration); | ||||
this.Close(); | this.Close(); | ||||
@@ -116,14 +123,17 @@ namespace Shadowsocks.View | |||||
{ | { | ||||
ProxyServerTextBox.Enabled = true; | ProxyServerTextBox.Enabled = true; | ||||
ProxyPortTextBox.Enabled = true; | ProxyPortTextBox.Enabled = true; | ||||
ProxyTimeoutTextBox.Enabled = true; | |||||
ProxyTypeComboBox.Enabled = true; | ProxyTypeComboBox.Enabled = true; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
ProxyServerTextBox.Clear(); | ProxyServerTextBox.Clear(); | ||||
ProxyPortTextBox.Clear(); | ProxyPortTextBox.Clear(); | ||||
ProxyTimeoutTextBox.Clear(); | |||||
ProxyServerTextBox.Enabled = false; | ProxyServerTextBox.Enabled = false; | ||||
ProxyPortTextBox.Enabled = false; | ProxyPortTextBox.Enabled = false; | ||||
ProxyTimeoutTextBox.Enabled = false; | |||||
ProxyTypeComboBox.Enabled = false; | ProxyTypeComboBox.Enabled = false; | ||||
} | } | ||||
} | } | ||||
@@ -1,120 +1,120 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<root> | |||||
<!-- | |||||
Microsoft ResX Schema | |||||
Version 2.0 | |||||
The primary goals of this format is to allow a simple XML format | |||||
that is mostly human readable. The generation and parsing of the | |||||
various data types are done through the TypeConverter classes | |||||
associated with the data types. | |||||
Example: | |||||
... ado.net/XML headers & schema ... | |||||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
<resheader name="version">2.0</resheader> | |||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
</data> | |||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
<comment>This is a comment</comment> | |||||
</data> | |||||
There are any number of "resheader" rows that contain simple | |||||
name/value pairs. | |||||
Each data row contains a name, and value. The row also contains a | |||||
type or mimetype. Type corresponds to a .NET class that support | |||||
text/value conversion through the TypeConverter architecture. | |||||
Classes that don't support this are serialized and stored with the | |||||
mimetype set. | |||||
The mimetype is used for serialized objects, and tells the | |||||
ResXResourceReader how to depersist the object. This is currently not | |||||
extensible. For a given mimetype the value must be set accordingly: | |||||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
that the ResXResourceWriter will generate, however the reader can | |||||
read any of the formats listed below. | |||||
mimetype: application/x-microsoft.net.object.binary.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.soap.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
value : The object must be serialized into a byte array | |||||
: using a System.ComponentModel.TypeConverter | |||||
: and then encoded with base64 encoding. | |||||
--> | |||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
<xsd:element name="root" msdata:IsDataSet="true"> | |||||
<xsd:complexType> | |||||
<xsd:choice maxOccurs="unbounded"> | |||||
<xsd:element name="metadata"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
<xsd:attribute name="type" type="xsd:string" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="assembly"> | |||||
<xsd:complexType> | |||||
<xsd:attribute name="alias" type="xsd:string" /> | |||||
<xsd:attribute name="name" type="xsd:string" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="data"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="resheader"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:choice> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:schema> | |||||
<resheader name="resmimetype"> | |||||
<value>text/microsoft-resx</value> | |||||
</resheader> | |||||
<resheader name="version"> | |||||
<value>2.0</value> | |||||
</resheader> | |||||
<resheader name="reader"> | |||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<resheader name="writer"> | |||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<root> | |||||
<!-- | |||||
Microsoft ResX Schema | |||||
Version 2.0 | |||||
The primary goals of this format is to allow a simple XML format | |||||
that is mostly human readable. The generation and parsing of the | |||||
various data types are done through the TypeConverter classes | |||||
associated with the data types. | |||||
Example: | |||||
... ado.net/XML headers & schema ... | |||||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
<resheader name="version">2.0</resheader> | |||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
</data> | |||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
<comment>This is a comment</comment> | |||||
</data> | |||||
There are any number of "resheader" rows that contain simple | |||||
name/value pairs. | |||||
Each data row contains a name, and value. The row also contains a | |||||
type or mimetype. Type corresponds to a .NET class that support | |||||
text/value conversion through the TypeConverter architecture. | |||||
Classes that don't support this are serialized and stored with the | |||||
mimetype set. | |||||
The mimetype is used for serialized objects, and tells the | |||||
ResXResourceReader how to depersist the object. This is currently not | |||||
extensible. For a given mimetype the value must be set accordingly: | |||||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
that the ResXResourceWriter will generate, however the reader can | |||||
read any of the formats listed below. | |||||
mimetype: application/x-microsoft.net.object.binary.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.soap.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
value : The object must be serialized into a byte array | |||||
: using a System.ComponentModel.TypeConverter | |||||
: and then encoded with base64 encoding. | |||||
--> | |||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
<xsd:element name="root" msdata:IsDataSet="true"> | |||||
<xsd:complexType> | |||||
<xsd:choice maxOccurs="unbounded"> | |||||
<xsd:element name="metadata"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
<xsd:attribute name="type" type="xsd:string" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="assembly"> | |||||
<xsd:complexType> | |||||
<xsd:attribute name="alias" type="xsd:string" /> | |||||
<xsd:attribute name="name" type="xsd:string" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="data"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="resheader"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:choice> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:schema> | |||||
<resheader name="resmimetype"> | |||||
<value>text/microsoft-resx</value> | |||||
</resheader> | |||||
<resheader name="version"> | |||||
<value>2.0</value> | |||||
</resheader> | |||||
<resheader name="reader"> | |||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<resheader name="writer"> | |||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
</root> | </root> |