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