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

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Windows;
using YAMP;
@@ -18,7 +19,7 @@ namespace Wox.Plugin.Caculator
@"[ei]|[0-9]|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
@")+$", RegexOptions.Compiled);
private static Regex regBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled);
private static ParseContext yampContext = null;
private static ParseContext yampContext;
private PluginInitContext context { get; set; }
static Calculator()
@@ -39,19 +40,21 @@ namespace Wox.Plugin.Caculator
var result = yampContext.Run(query.Search);
if (result.Output != null && !string.IsNullOrEmpty(result.Result))
{
return new List<Result>() { new Result() {
return new List<Result>
{ new Result
{
Title = result.Result,
IcoPath = "Images/calculator.png",
Score = 300,
SubTitle = "Copy this number to the clipboard",
Action = (c) =>
Action = c =>
{
try
{
Clipboard.SetText(result.Result);
return true;
}
catch (System.Runtime.InteropServices.ExternalException e)
catch (ExternalException e)
{
MessageBox.Show("Copy failed, please try later");
return false;