some work for loading a workspace

This commit is contained in:
2024-09-06 16:55:04 +02:00
parent f0f63a1895
commit 5e678db077
7 changed files with 114 additions and 14 deletions

View File

@@ -17,7 +17,7 @@ internal class GitLabRepoWorkspaceFeature : WorkspaceFeature, IPluginFeatureProv
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small);
}
protected override bool OnConfigure(ref IWorkspace workspace)
protected override bool OnConfigure(ref IWorkspace? workspace)
{
var settings = workspace?.Config as GitLabRepoWorkspaceConfig ?? new();
@@ -25,6 +25,15 @@ internal class GitLabRepoWorkspaceFeature : WorkspaceFeature, IPluginFeatureProv
return false;
workspace = new GitLabRepoWorkspace(settings);
return true;
}
protected override void OnCreate(out IWorkspace workspace, WorkspaceConfig config)
{
if (config is not GitLabRepoWorkspaceConfig gitlabConfig)
throw new NotImplementedException($"Only configs of type {typeof(GitLabRepoWorkspaceConfig).Name} are allowed.");
workspace = new GitLabRepoWorkspace(gitlabConfig);
}
}