PowerToys/Wox.Plugin.System/DirectoryIndicator.cs

43 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
2014-01-29 11:33:24 +01:00
namespace Wox.Plugin.System
{
2014-01-15 15:45:02 +01:00
public class DirectoryIndicator : BaseSystemPlugin
{
2014-01-15 15:45:02 +01:00
protected override List<Result> QueryInternal(Query query)
{
List<Result> results = new List<Result>();
if (string.IsNullOrEmpty(query.RawQuery)) return results;
2014-01-15 15:45:02 +01:00
if (Directory.Exists(query.RawQuery))
{
Result result = new Result
{
Title = "Open this directory",
SubTitle = string.Format("path: {0}", query.RawQuery),
Score = 50,
IcoPath = "Images/folder.png",
Action = (c) =>
{
Process.Start(query.RawQuery);
}
};
results.Add(result);
}
return results;
}
2014-01-15 15:45:02 +01:00
protected override void InitInternal(PluginInitContext context)
{
}
}
}