formatting and description

This commit is contained in:
Jeremy Wu 2021-01-17 18:47:19 +11:00
parent 763b51858f
commit 114c12bdaf
6 changed files with 15 additions and 7 deletions

View file

@ -320,4 +320,4 @@ namespace Flow.Launcher.Core.Plugin
}
}
}
}
}

View file

@ -12,6 +12,10 @@ namespace Flow.Launcher.Plugin
/// <summary>
/// Asynchronous Querying
/// </summary>
/// <para>
/// If the Querying or Init method requires high IO transmission
/// or performing CPU intense jobs (performing better with cancellation), please use this IAsyncPlugin interface
/// </para>
/// <param name="query">Query to search</param>
/// <param name="token">Cancel when querying job is obsolete</param>
/// <returns></returns>

View file

@ -5,8 +5,8 @@ namespace Flow.Launcher.Plugin
/// <summary>
/// Synchronous Plugin Model for Flow Launcher
/// <para>
/// If you assume that Querying or Init method require IO transmission
/// or CPU Intense Job (performing better with cancellation), please try IAsyncPlugin interface
/// If the Querying or Init method requires high IO transmission
/// or performaing CPU intense jobs (performing better with cancellation), please try the IAsyncPlugin interface
/// </para>
/// </summary>
public interface IPlugin

View file

@ -12,7 +12,7 @@
/// it will call the plugins that have implemented this interface.
///
/// <para>
/// If requiring reloading data asynchrouly, please try IAsyncReloadable
/// If requiring reloading data asynchronously, please use the IAsyncReloadable interface
/// </para>
/// </summary>
public interface IReloadable

View file

@ -408,8 +408,13 @@ namespace Flow.Launcher.ViewModel
for (var i = 0; i < plugins.Count; i++)
{
if (!plugins[i].Metadata.Disabled)
{
tasks[i] = QueryTask(plugins[i], query, currentCancellationToken);
else tasks[i] = Task.CompletedTask; // Avoid Null
}
else
{
tasks[i] = Task.CompletedTask; // Avoid Null
}
}
// Check the code, WhenAll will translate all type of IEnumerable or Collection to Array, so make an array at first
@ -429,7 +434,7 @@ namespace Flow.Launcher.ViewModel
ProgressBarVisibility = Visibility.Hidden;
}
// Local Function
// Local function
async Task QueryTask(PluginPair plugin, Query query, CancellationToken token)
{
// Since it is wrapped within a Task.Run, the synchronous context is null

View file

@ -4,7 +4,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;
namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
{