31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using ModpackUpdater.Apps.Manager.Api.Model;
|
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using Pilz.Plugins.Advanced;
|
|
using Pilz.UI.Extensions;
|
|
using Pilz.UI.Symbols;
|
|
using Pilz.UI.Telerik.Dialogs;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
|
|
|
|
internal class GitLabRepoWorkspaceFeature : WorkspaceFeature, IPluginFeatureProvider<GitLabRepoWorkspaceFeature>
|
|
{
|
|
public static GitLabRepoWorkspaceFeature Instance { get; } = new();
|
|
|
|
public GitLabRepoWorkspaceFeature() : base("origin.gitlab", "GitLab repository")
|
|
{
|
|
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small);
|
|
}
|
|
|
|
protected override bool OnConfigure(ref IWorkspace workspace)
|
|
{
|
|
var settings = workspace?.Config as GitLabRepoWorkspaceConfig ?? new();
|
|
|
|
if (RadDialogBase.ShowDialog(new GitLabRepoWorkspaceConfigEditor(settings), TitlesLangRes.GitLabRepoWorkspaceEditor, AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small)).Result.IsNotOk())
|
|
return false;
|
|
|
|
workspace = new GitLabRepoWorkspace(settings);
|
|
return true;
|
|
}
|
|
}
|