FileSystemPlugin

Check for invalid paths
[Open this directory] Action always appears at top is path is existing
directory or parent is
This commit is contained in:
Aaron Campf
2014-05-20 16:45:11 -07:00
parent 60f4937aae
commit cefa8326e3
4 changed files with 53 additions and 54 deletions

View File

@@ -21,6 +21,7 @@ using UnhandledExceptionEventArgs = System.UnhandledExceptionEventArgs;
namespace Wox {
public static class EntryPoint {
[STAThread]
[System.Diagnostics.DebuggerStepThrough]
public static void Main(string[] args) {
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
System.Windows.Forms.Application.ThreadException += ErrorReporting.ThreadException;
@@ -30,7 +31,7 @@ namespace Wox {
Entry(args);
}
[System.Diagnostics.DebuggerStepThrough]
private static void Entry(string[] args) {
SingleInstanceManager manager = new SingleInstanceManager();
manager.Run(args);

View File

@@ -324,7 +324,7 @@ namespace Wox {
private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) {
if (UserSettingStorage.Instance.ReplaceWinR) {
//todo:need refatoring. move those codes to CMD file or expose events
//todo:need refactoring. move those codes to CMD file or expose events
if (keyevent == KeyEvent.WM_KEYDOWN && vkcode == (int)Keys.R && state.WinPressed) {
WinRStroked = true;
Dispatcher.BeginInvoke(new Action(OnWinRPressed));
@@ -453,7 +453,7 @@ namespace Wox {
queryHasReturn = true;
progressBar.Dispatcher.Invoke(new Action(StopProgress));
if (list.Count > 0) {
//todo:this should be opened to users, it's their choise to use it or not in thier workflows
//todo:this should be opened to users, it's their choice to use it or not in their workflows
list.ForEach(
o => {
if (o.AutoAjustScore) o.Score += UserSelectedRecordStorage.Instance.GetSelectedCount(o);

View File

@@ -11,7 +11,7 @@ namespace Wox.PluginLoader {
public class CSharpPluginLoader : BasePluginLoader {
public override List<PluginPair> LoadPlugin() {
List<PluginPair> plugins = new List<PluginPair>();
var plugins = new List<PluginPair>();
List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.CSharp.ToUpper()).ToList();
foreach (PluginMetadata metadata in metadatas) {
@@ -19,7 +19,7 @@ namespace Wox.PluginLoader {
Assembly asm = Assembly.Load(AssemblyName.GetAssemblyName(metadata.ExecuteFilePath));
List<Type> types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && (o.BaseType == typeof(BaseSystemPlugin) || o.GetInterfaces().Contains(typeof(IPlugin)))).ToList();
if (types.Count == 0) {
Log.Warn(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin", metadata.Name));
Log.Warn(string.Format("Couldn't load plugin {0}: didn't find the class who implement IPlugin", metadata.Name));
continue;
}
@@ -38,7 +38,7 @@ namespace Wox.PluginLoader {
}
}
catch (Exception e) {
Log.Error(string.Format("Cound't load plugin {0}: {1}", metadata.Name, e.Message));
Log.Error(string.Format("Couldn't load plugin {0}: {1}", metadata.Name, e.Message));
#if (DEBUG)
{
throw;