From 9194b0325fe27f46eb43a0dc0a51b7d5c0785f02 Mon Sep 17 00:00:00 2001 From: kimw Date: Mon, 4 Jan 2016 23:57:30 +0800 Subject: [PATCH] avoid warning message while compile --- shadowsocks-csharp/Encryption/MbedTLS.cs | 2 +- .../Model/StatisticsStrategyConfiguration.cs | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/shadowsocks-csharp/Encryption/MbedTLS.cs b/shadowsocks-csharp/Encryption/MbedTLS.cs index 8ad9cd09..a7162f66 100644 --- a/shadowsocks-csharp/Encryption/MbedTLS.cs +++ b/shadowsocks-csharp/Encryption/MbedTLS.cs @@ -19,7 +19,7 @@ namespace Shadowsocks.Encryption { FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll); } - catch (IOException ex) + catch (IOException) { } catch (Exception e) diff --git a/shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs b/shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs index 62a48c2e..70433117 100644 --- a/shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs +++ b/shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs @@ -3,17 +3,17 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using Shadowsocks.Controller; -using Shadowsocks.Controller.Strategy; -using SimpleJson; + using Newtonsoft.Json; +using Shadowsocks.Controller; + namespace Shadowsocks.Model { [Serializable] public class StatisticsStrategyConfiguration { - public static readonly string ID = "com.shadowsocks.strategy.statistics"; + public static readonly string ID = "com.shadowsocks.strategy.statistics"; private bool _statisticsEnabled = true; private bool _byIsp = false; private bool _byHourOfDay = false; @@ -21,7 +21,6 @@ namespace Shadowsocks.Model private int _dataCollectionMinutes = 10; private int _repeatTimesNum = 4; - private const string ConfigFile = "statistics-config.json"; public static StatisticsStrategyConfiguration Load() @@ -32,7 +31,7 @@ namespace Shadowsocks.Model var configuration = JsonConvert.DeserializeObject(content); return configuration; } - catch (FileNotFoundException e) + catch (FileNotFoundException) { var configuration = new StatisticsStrategyConfiguration(); Save(configuration); @@ -62,10 +61,10 @@ namespace Shadowsocks.Model public StatisticsStrategyConfiguration() { - var availabilityStatisticsType = typeof (AvailabilityStatistics); + var availabilityStatisticsType = typeof(AvailabilityStatistics); var statisticsData = availabilityStatisticsType.GetNestedType("StatisticsData"); var properties = statisticsData.GetFields(BindingFlags.Instance | BindingFlags.Public); - Calculations = properties.ToDictionary(p => p.Name, _ => (float) 0); + Calculations = properties.ToDictionary(p => p.Name, _ => (float)0); } public bool StatisticsEnabled