From c22c8412077e27ec23f6b0833182d16e4fddbee8 Mon Sep 17 00:00:00 2001 From: wzxjohn Date: Sun, 9 Nov 2014 15:01:36 +0800 Subject: [PATCH] add modify detector Don't reload server if config not change. --- .../Controller/ShadowsocksController.cs | 20 +------------------- shadowsocks-csharp/View/ConfigForm.Designer.cs | 1 - shadowsocks-csharp/View/QRCodeForm.cs | 4 ++-- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 2fc8eeeb..ec6dc25f 100755 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -52,7 +52,7 @@ namespace Shadowsocks.Controller UpdateSystemProxy(); } - + public Server GetCurrentServer() { return _config.GetCurrentServer(); @@ -179,23 +179,5 @@ namespace Shadowsocks.Controller { UpdateSystemProxy(); } - - private void SetLog() - { - try - { - FileStream fs = new FileStream("shadowsocks.log", FileMode.Append); - TextWriter tmp = Console.Out; - StreamWriter sw = new StreamWriter(fs); - sw.AutoFlush = true; - Console.SetOut(sw); - Console.SetError(sw); - } - catch (IOException e) - { - Console.WriteLine(e.ToString()); - } - } - } } diff --git a/shadowsocks-csharp/View/ConfigForm.Designer.cs b/shadowsocks-csharp/View/ConfigForm.Designer.cs index c1187c04..cf874286 100755 --- a/shadowsocks-csharp/View/ConfigForm.Designer.cs +++ b/shadowsocks-csharp/View/ConfigForm.Designer.cs @@ -434,7 +434,6 @@ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; - this.MinimizeBox = false; this.Name = "ConfigForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Edit Servers"; diff --git a/shadowsocks-csharp/View/QRCodeForm.cs b/shadowsocks-csharp/View/QRCodeForm.cs index 12c5b6fd..87bcef50 100755 --- a/shadowsocks-csharp/View/QRCodeForm.cs +++ b/shadowsocks-csharp/View/QRCodeForm.cs @@ -24,12 +24,12 @@ namespace Shadowsocks.View private void GenQR(string ssconfig) { - string qrText = ssconfig; + string qrText = ssconfig; QRCode4CS.Options options = new QRCode4CS.Options(); options.Text = qrText; QRCode4CS.QRCode qrCoded = null; bool success = false; - foreach (var level in new QRErrorCorrectLevel[]{QRErrorCorrectLevel.H, QRErrorCorrectLevel.Q, QRErrorCorrectLevel.M, QRErrorCorrectLevel.L}) + foreach (var level in new QRErrorCorrectLevel[]{QRErrorCorrectLevel.H, QRErrorCorrectLevel.Q, QRErrorCorrectLevel.M, QRErrorCorrectLevel.L}) { for (int i = 3; i < 10; i++) {