Browse Source

avoid warning message while compile

tags/3.0
kimw 9 years ago
parent
commit
9194b0325f
2 changed files with 8 additions and 9 deletions
  1. +1
    -1
      shadowsocks-csharp/Encryption/MbedTLS.cs
  2. +7
    -8
      shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs

+ 1
- 1
shadowsocks-csharp/Encryption/MbedTLS.cs View File

@@ -19,7 +19,7 @@ namespace Shadowsocks.Encryption
{ {
FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll); FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll);
} }
catch (IOException ex)
catch (IOException)
{ {
} }
catch (Exception e) catch (Exception e)


+ 7
- 8
shadowsocks-csharp/Model/StatisticsStrategyConfiguration.cs View File

@@ -3,17 +3,17 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Shadowsocks.Controller;
using Shadowsocks.Controller.Strategy;
using SimpleJson;

using Newtonsoft.Json; using Newtonsoft.Json;


using Shadowsocks.Controller;

namespace Shadowsocks.Model namespace Shadowsocks.Model
{ {
[Serializable] [Serializable]
public class StatisticsStrategyConfiguration 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 _statisticsEnabled = true;
private bool _byIsp = false; private bool _byIsp = false;
private bool _byHourOfDay = false; private bool _byHourOfDay = false;
@@ -21,7 +21,6 @@ namespace Shadowsocks.Model
private int _dataCollectionMinutes = 10; private int _dataCollectionMinutes = 10;
private int _repeatTimesNum = 4; private int _repeatTimesNum = 4;



private const string ConfigFile = "statistics-config.json"; private const string ConfigFile = "statistics-config.json";


public static StatisticsStrategyConfiguration Load() public static StatisticsStrategyConfiguration Load()
@@ -32,7 +31,7 @@ namespace Shadowsocks.Model
var configuration = JsonConvert.DeserializeObject<StatisticsStrategyConfiguration>(content); var configuration = JsonConvert.DeserializeObject<StatisticsStrategyConfiguration>(content);
return configuration; return configuration;
} }
catch (FileNotFoundException e)
catch (FileNotFoundException)
{ {
var configuration = new StatisticsStrategyConfiguration(); var configuration = new StatisticsStrategyConfiguration();
Save(configuration); Save(configuration);
@@ -62,10 +61,10 @@ namespace Shadowsocks.Model


public StatisticsStrategyConfiguration() public StatisticsStrategyConfiguration()
{ {
var availabilityStatisticsType = typeof (AvailabilityStatistics);
var availabilityStatisticsType = typeof(AvailabilityStatistics);
var statisticsData = availabilityStatisticsType.GetNestedType("StatisticsData"); var statisticsData = availabilityStatisticsType.GetNestedType("StatisticsData");
var properties = statisticsData.GetFields(BindingFlags.Instance | BindingFlags.Public); 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 public bool StatisticsEnabled


Loading…
Cancel
Save