-> let's use wine for comatibility again -> easier to maintain -> easier to build dynamic options with
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|