Add post-action

This commit is contained in:
Yaroslav Zyubanov
2014-06-04 21:22:34 +06:00
parent 47a0642c4d
commit 2ee671a1ae

View File

@@ -4,6 +4,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Windows;
namespace Wox.Plugin.SystemPlugins namespace Wox.Plugin.SystemPlugins
{ {
@@ -36,9 +37,30 @@ namespace Wox.Plugin.SystemPlugins
if (cached.Length == 0) if (cached.Length == 0)
{ {
var path = CreateImage(raw); var path = CreateImage(raw);
return new List<Result> {new Result(raw, path)}; return new List<Result>
{
new Result
{
Title = raw,
IcoPath = path,
Action = _ =>
{
Clipboard.SetText(raw);
return true;
} }
return cached.Select(x => new Result(raw, x.FullName)).ToList(); }
};
}
return cached.Select(x => new Result
{
Title = raw,
IcoPath = x.FullName,
Action = _ =>
{
Clipboard.SetText(raw);
return true;
}
}).ToList();
} }
catch (Exception exception) catch (Exception exception)
{ {