mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
formatting and description
This commit is contained in:
parent
763b51858f
commit
114c12bdaf
6 changed files with 15 additions and 7 deletions
|
|
@ -320,4 +320,4 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue