ReSharper: remove redundant code

This commit is contained in:
bao-qian
2016-01-06 21:34:42 +00:00
parent ae42c4df16
commit 0daa3a8f57
65 changed files with 279 additions and 250 deletions

View File

@@ -28,7 +28,7 @@ namespace Wox.Infrastructure
public MatchResult Evaluate(string str)
{
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult() { Success = false };
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult { Success = false };
var len = str.Length;
var compareString = opt.IgnoreCase ? str.ToLower() : str;
@@ -67,7 +67,7 @@ namespace Wox.Infrastructure
// return rendered string if we have a match for every char
if (patternIdx == pattern.Length)
{
return new MatchResult()
return new MatchResult
{
Success = true,
Value = sb.ToString(),
@@ -75,7 +75,7 @@ namespace Wox.Infrastructure
};
}
return new MatchResult() { Success = false };
return new MatchResult { Success = false };
}
private int CalScore(string str, int firstIndex, int matchLen)
@@ -107,9 +107,9 @@ namespace Wox.Infrastructure
{
public MatchOption()
{
this.Prefix = "";
this.Suffix = "";
this.IgnoreCase = true;
Prefix = "";
Suffix = "";
IgnoreCase = true;
}
/// <summary>

View File

@@ -131,7 +131,7 @@ namespace Wox.Infrastructure.Hotkey
if (CharKey != Key.None)
{
text += specialSymbolDictionary.ContainsKey(CharKey)
? specialSymbolDictionary[CharKey].ToString()
? specialSymbolDictionary[CharKey]
: CharKey.ToString();
}
else if (!string.IsNullOrEmpty(text))

View File

@@ -1,6 +1,6 @@
namespace Wox.Infrastructure.Hotkey
{
public enum KeyEvent:int
public enum KeyEvent
{
/// <summary>
/// Key down

View File

@@ -1,6 +1,7 @@
using System.IO;
using System.Net;
using System.Text;
using Wox.Infrastructure.Logger;
using Wox.Plugin;
namespace Wox.Infrastructure.Http
@@ -56,7 +57,7 @@ namespace Wox.Infrastructure.Http
}
catch (System.Exception e)
{
Logger.Log.Error(e);
Log.Error(e);
return string.Empty;
}
@@ -109,7 +110,7 @@ namespace Wox.Infrastructure.Http
}
catch (System.Exception e)
{
Logger.Log.Error(e);
Log.Error(e);
return string.Empty;
}

View File

@@ -1,5 +1,4 @@
using NLog;
using Wox.Infrastructure.Exception;
namespace Wox.Infrastructure.Logger
{

View File

@@ -69,7 +69,7 @@ namespace Wox.Infrastructure.Storage
}
}
private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
Assembly ayResult = null;
string sShortAssemblyName = args.Name.Split(',')[0];