mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
fix issues
This commit is contained in:
@@ -10,7 +10,12 @@ namespace WinAlfred.Commands
|
||||
{
|
||||
private MainWindow window;
|
||||
|
||||
public abstract void Dispatch(Query query);
|
||||
public void Dispatch(Query query)
|
||||
{
|
||||
Dispatch(query, true);
|
||||
}
|
||||
|
||||
public abstract void Dispatch(Query query, bool updateView);
|
||||
|
||||
//TODO:Ugly, we should subscribe events here, instead of just use usercontrol as the parameter
|
||||
protected BaseCommand(MainWindow window)
|
||||
|
||||
@@ -23,5 +23,11 @@ namespace WinAlfred.Commands
|
||||
systemCmd.Dispatch(query);
|
||||
pluginCmd.Dispatch(query);
|
||||
}
|
||||
|
||||
public void DispatchCommand(Query query,bool updateView)
|
||||
{
|
||||
systemCmd.Dispatch(query,updateView);
|
||||
pluginCmd.Dispatch(query,updateView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace WinAlfred.Commands
|
||||
|
||||
}
|
||||
|
||||
public override void Dispatch(Query q)
|
||||
public override void Dispatch(Query q,bool updateView)
|
||||
{
|
||||
PluginPair thirdPlugin = Plugins.AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == q.ActionName);
|
||||
if (thirdPlugin != null && !string.IsNullOrEmpty(thirdPlugin.Metadata.ActionKeyword))
|
||||
@@ -39,7 +39,7 @@ namespace WinAlfred.Commands
|
||||
o.PluginDirectory = thirdPlugin.Metadata.PluginDirecotry;
|
||||
o.OriginQuery = q;
|
||||
});
|
||||
UpdateResultView(r);
|
||||
if(updateView) UpdateResultView(r);
|
||||
}
|
||||
catch (Exception queryException)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace WinAlfred.Commands
|
||||
systemPlugins = Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System).ToList();
|
||||
}
|
||||
|
||||
public override void Dispatch(Query query)
|
||||
public override void Dispatch(Query query,bool updateView)
|
||||
{
|
||||
foreach (PluginPair pair in systemPlugins)
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace WinAlfred.Commands
|
||||
result.PluginDirectory = pair1.Metadata.PluginDirecotry;
|
||||
result.OriginQuery = query;
|
||||
}
|
||||
if(results.Count > 0) UpdateResultView(results);
|
||||
if(results.Count > 0 && updateView) UpdateResultView(results);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user