@@ -485,48 +485,16 @@ public static async Task<List<DialogJumpResult>> QueryDialogJumpForPluginAsync(P
485
485
486
486
#endregion
487
487
488
- #region Update Metadata & Get Plugin
489
-
490
- public static void UpdatePluginMetadata ( IReadOnlyList < Result > results , PluginMetadata metadata , Query query )
491
- {
492
- foreach ( var r in results )
493
- {
494
- r . PluginDirectory = metadata . PluginDirectory ;
495
- r . PluginID = metadata . ID ;
496
- r . OriginQuery = query ;
497
-
498
- // ActionKeywordAssigned is used for constructing MainViewModel's query text auto-complete suggestions
499
- // Plugins may have multi-actionkeywords eg. WebSearches. In this scenario it needs to be overriden on the plugin level
500
- if ( metadata . ActionKeywords . Count == 1 )
501
- r . ActionKeywordAssigned = query . ActionKeyword ;
502
- }
503
- }
504
-
505
- /// <summary>
506
- /// get specified plugin, return null if not found
507
- /// </summary>
508
- /// <remarks>
509
- /// Plugin may not be initialized, so do not use its plugin model to execute any commands
510
- /// </remarks>
511
- /// <param name="id"></param>
512
- /// <returns></returns>
513
- public static PluginPair GetPluginForId ( string id )
514
- {
515
- return GetAllLoadedPlugins ( ) . FirstOrDefault ( o => o . Metadata . ID == id ) ;
516
- }
517
-
518
- #endregion
519
-
520
488
#region Get Plugin List
521
489
522
490
public static List < PluginPair > GetAllLoadedPlugins ( )
523
491
{
524
492
return [ .. _allLoadedPlugins ] ;
525
493
}
526
494
527
- public static List < PluginPair > GetAllInitializedPlugins ( bool containFailed )
495
+ public static List < PluginPair > GetAllInitializedPlugins ( bool includeFailed )
528
496
{
529
- if ( containFailed )
497
+ if ( includeFailed )
530
498
{
531
499
return [ .. _allInitializedPlugins . Values ] ;
532
500
}
@@ -554,6 +522,38 @@ public static List<PluginPair> GetTranslationPlugins()
554
522
555
523
#endregion
556
524
525
+ #region Update Metadata & Get Plugin
526
+
527
+ public static void UpdatePluginMetadata ( IReadOnlyList < Result > results , PluginMetadata metadata , Query query )
528
+ {
529
+ foreach ( var r in results )
530
+ {
531
+ r . PluginDirectory = metadata . PluginDirectory ;
532
+ r . PluginID = metadata . ID ;
533
+ r . OriginQuery = query ;
534
+
535
+ // ActionKeywordAssigned is used for constructing MainViewModel's query text auto-complete suggestions
536
+ // Plugins may have multi-actionkeywords eg. WebSearches. In this scenario it needs to be overriden on the plugin level
537
+ if ( metadata . ActionKeywords . Count == 1 )
538
+ r . ActionKeywordAssigned = query . ActionKeyword ;
539
+ }
540
+ }
541
+
542
+ /// <summary>
543
+ /// get specified plugin, return null if not found
544
+ /// </summary>
545
+ /// <remarks>
546
+ /// Plugin may not be initialized, so do not use its plugin model to execute any commands
547
+ /// </remarks>
548
+ /// <param name="id"></param>
549
+ /// <returns></returns>
550
+ public static PluginPair GetPluginForId ( string id )
551
+ {
552
+ return GetAllLoadedPlugins ( ) . FirstOrDefault ( o => o . Metadata . ID == id ) ;
553
+ }
554
+
555
+ #endregion
556
+
557
557
#region Get Context Menus
558
558
559
559
public static List < Result > GetContextMenusForPlugin ( Result result )
0 commit comments