move actions to separated code & add sinlge update search action
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using ModpackUpdater.Apps.Manager.Ui;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Features.CM;
|
||||
|
||||
internal class CheckSingleActionHealthyFeature : PluginFunction, IPluginFeatureProvider<CheckSingleActionHealthyFeature>
|
||||
{
|
||||
public static CheckSingleActionHealthyFeature Instance { get; } = new();
|
||||
|
||||
public CheckSingleActionHealthyFeature() : base(FeatureTypes.ActionsContextMenu, "origin.checksingleactionhearlthy", FeatureNamesLangRes.CheckSingleActionHealthy)
|
||||
{
|
||||
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.heart_with_pulse, Pilz.UI.Symbols.SymbolSize.Small);
|
||||
}
|
||||
|
||||
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
||||
{
|
||||
if (@params is not MainApiParameters p
|
||||
|| p.Api.MainWindow is not MainForm mainForm
|
||||
|| mainForm.Controls.Find("radGridView_Actions", true).FirstOrDefault() is not RadGridView gridView
|
||||
|| gridView.SelectedRows.FirstOrDefault() is not GridViewRowInfo row
|
||||
|| row.Tag is not InstallAction)
|
||||
return null;
|
||||
|
||||
SharedFunctions.CheckActionHealthy(p.Api, row);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using ModpackUpdater.Apps.Manager.Ui;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using Pilz.UI.Symbols;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Features.CM;
|
||||
internal class UpdateCollectorFeature : PluginFunction, IPluginFeatureProvider<UpdateCollectorFeature>
|
||||
{
|
||||
public static UpdateCollectorFeature Instance { get; } = new();
|
||||
|
||||
public UpdateCollectorFeature() : base(FeatureTypes.ActionsContextMenu, "origin.updatecollector", FeatureNamesLangRes.UpdateCollectorFeature)
|
||||
{
|
||||
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.search, SymbolSize.Small);
|
||||
}
|
||||
|
||||
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
||||
{
|
||||
if (@params is not MainApiParameters p
|
||||
|| p.Api.CurWorkspace?.UpdateInfos is null
|
||||
|| p.Api.MainWindow is not MainForm mainForm
|
||||
|| mainForm.Controls.Find("radGridView_Actions", true).FirstOrDefault() is not RadGridView gridView
|
||||
|| gridView.SelectedRows.FirstOrDefault()?.Tag is not InstallAction selectedAction)
|
||||
return null;
|
||||
|
||||
SharedFunctions.CollectUpdates(p.Api, selectedAction);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user