some work on Manager

This commit is contained in:
2024-09-06 09:44:24 +02:00
parent 5bccd070f4
commit ebc57e05d5
14 changed files with 367 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
namespace ModpackUpdater.Apps.Manager.Api.Model;
public interface IWorkspace
{
}

View File

@@ -0,0 +1,7 @@
using Pilz.Plugins.Advanced;
namespace ModpackUpdater.Apps.Manager.Api.Plugins.Params;
public class WorkspaceInitParameters : PluginFunctionParameter
{
}

View File

@@ -0,0 +1,6 @@
namespace ModpackUpdater.Apps.Manager;
public static class FeatureTypes
{
public static string Workspace => "workspace";
}

View File

@@ -0,0 +1,7 @@
using ModpackUpdater.Apps.Manager.Api.Model;
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
internal class GitLabRepoWorkspace : IWorkspace
{
}

View File

@@ -0,0 +1,36 @@
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
partial class GitLabRepoWorkspaceConfigEditor
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
public partial class GitLabRepoWorkspaceConfigEditor : UserControl
{
public GitLabRepoWorkspaceConfigEditor()
{
InitializeComponent();
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
using ModpackUpdater.Apps.Manager.Api.Model;
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
using Pilz.Plugins.Advanced;
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
internal class GitLabRepoWorkspaceFeature : PluginFunction, IPluginFeatureProvider<GitLabRepoWorkspaceFeature>
{
public static GitLabRepoWorkspaceFeature Instance { get; } = new();
public GitLabRepoWorkspaceFeature() : base(FeatureTypes.Workspace, "origin.gitlab", "GitLab repository")
{
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.github, Pilz.UI.Symbols.SymbolSize.Small);
}
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
{
if (@params is not WorkspaceInitParameters p)
return null;
/// Open config UI
/// ...
return new GitLabRepoWorkspace();
}
}

View File

@@ -0,0 +1,5 @@
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
internal class GitLabRepoWorkspaceSettings
{
}

View File

@@ -28,13 +28,30 @@ partial class Form1
/// </summary>
private void InitializeComponent()
{
var tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition();
radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer();
splitPanel1 = new Telerik.WinControls.UI.SplitPanel();
tableLayoutPanel2 = new TableLayoutPanel();
radTreeView_Updates = new Telerik.WinControls.UI.RadTreeView();
splitPanel2 = new Telerik.WinControls.UI.SplitPanel();
tableLayoutPanel1 = new TableLayoutPanel();
radGridView_Actions = new Telerik.WinControls.UI.RadGridView();
radMenuItem1 = new Telerik.WinControls.UI.RadMenuItem();
radMenuItem_OpenWorkspace = new Telerik.WinControls.UI.RadMenuItem();
radMenuItem2 = new Telerik.WinControls.UI.RadMenuItem();
radMenu1 = new Telerik.WinControls.UI.RadMenu();
((System.ComponentModel.ISupportInitialize)radSplitContainer1).BeginInit();
radSplitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)splitPanel1).BeginInit();
splitPanel1.SuspendLayout();
tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)radTreeView_Updates).BeginInit();
((System.ComponentModel.ISupportInitialize)splitPanel2).BeginInit();
splitPanel2.SuspendLayout();
tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)radGridView_Actions).BeginInit();
((System.ComponentModel.ISupportInitialize)radGridView_Actions.MasterTemplate).BeginInit();
((System.ComponentModel.ISupportInitialize)radMenu1).BeginInit();
((System.ComponentModel.ISupportInitialize)this).BeginInit();
SuspendLayout();
//
@@ -43,41 +60,118 @@ partial class Form1
radSplitContainer1.Controls.Add(splitPanel1);
radSplitContainer1.Controls.Add(splitPanel2);
radSplitContainer1.Dock = DockStyle.Fill;
radSplitContainer1.Location = new Point(0, 0);
radSplitContainer1.Location = new Point(0, 28);
radSplitContainer1.Name = "radSplitContainer1";
//
//
//
radSplitContainer1.RootElement.MinSize = new Size(25, 25);
radSplitContainer1.Size = new Size(800, 450);
radSplitContainer1.Size = new Size(800, 422);
radSplitContainer1.TabIndex = 0;
radSplitContainer1.TabStop = false;
//
// splitPanel1
//
splitPanel1.Controls.Add(tableLayoutPanel2);
splitPanel1.Location = new Point(0, 0);
splitPanel1.Name = "splitPanel1";
//
//
//
splitPanel1.RootElement.MinSize = new Size(25, 25);
splitPanel1.Size = new Size(398, 450);
splitPanel1.Size = new Size(246, 422);
splitPanel1.SizeInfo.AutoSizeScale = new SizeF(-0.190954775F, 0F);
splitPanel1.SizeInfo.SplitterCorrection = new Size(-152, 0);
splitPanel1.TabIndex = 0;
splitPanel1.TabStop = false;
splitPanel1.Text = "splitPanel1";
//
// tableLayoutPanel2
//
tableLayoutPanel2.ColumnCount = 1;
tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel2.Controls.Add(radTreeView_Updates, 0, 0);
tableLayoutPanel2.Dock = DockStyle.Fill;
tableLayoutPanel2.Location = new Point(0, 0);
tableLayoutPanel2.Name = "tableLayoutPanel2";
tableLayoutPanel2.RowCount = 1;
tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableLayoutPanel2.Size = new Size(246, 422);
tableLayoutPanel2.TabIndex = 1;
//
// radTreeView_Updates
//
radTreeView_Updates.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
radTreeView_Updates.ItemHeight = 24;
radTreeView_Updates.LineColor = Color.FromArgb(152, 152, 152);
radTreeView_Updates.LineStyle = Telerik.WinControls.UI.TreeLineStyle.Solid;
radTreeView_Updates.Location = new Point(3, 3);
radTreeView_Updates.Name = "radTreeView_Updates";
radTreeView_Updates.Size = new Size(240, 416);
radTreeView_Updates.TabIndex = 0;
//
// splitPanel2
//
splitPanel2.Location = new Point(402, 0);
splitPanel2.Controls.Add(tableLayoutPanel1);
splitPanel2.Location = new Point(250, 0);
splitPanel2.Name = "splitPanel2";
//
//
//
splitPanel2.RootElement.MinSize = new Size(25, 25);
splitPanel2.Size = new Size(398, 450);
splitPanel2.Size = new Size(550, 422);
splitPanel2.SizeInfo.AutoSizeScale = new SizeF(0.190954745F, 0F);
splitPanel2.SizeInfo.SplitterCorrection = new Size(152, 0);
splitPanel2.TabIndex = 1;
splitPanel2.TabStop = false;
splitPanel2.Text = "splitPanel2";
//
// tableLayoutPanel1
//
tableLayoutPanel1.ColumnCount = 1;
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel1.Controls.Add(radGridView_Actions, 0, 0);
tableLayoutPanel1.Dock = DockStyle.Fill;
tableLayoutPanel1.Location = new Point(0, 0);
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.RowCount = 1;
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableLayoutPanel1.Size = new Size(550, 422);
tableLayoutPanel1.TabIndex = 0;
//
// radGridView_Actions
//
radGridView_Actions.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
radGridView_Actions.Location = new Point(3, 3);
//
//
//
radGridView_Actions.MasterTemplate.ViewDefinition = tableViewDefinition2;
radGridView_Actions.Name = "radGridView_Actions";
radGridView_Actions.Size = new Size(544, 416);
radGridView_Actions.TabIndex = 0;
//
// radMenuItem1
//
radMenuItem1.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_OpenWorkspace });
radMenuItem1.Name = "radMenuItem1";
radMenuItem1.Text = "File";
//
// radMenuItem_OpenWorkspace
//
radMenuItem_OpenWorkspace.Name = "radMenuItem_OpenWorkspace";
radMenuItem_OpenWorkspace.Text = "Open workspace";
//
// radMenuItem2
//
radMenuItem2.Name = "radMenuItem2";
radMenuItem2.Text = "Tools";
//
// radMenu1
//
radMenu1.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem1, radMenuItem2 });
radMenu1.Location = new Point(0, 0);
radMenu1.Name = "radMenu1";
radMenu1.Size = new Size(800, 28);
radMenu1.TabIndex = 1;
//
// Form1
//
@@ -86,14 +180,25 @@ partial class Form1
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(radSplitContainer1);
Controls.Add(radMenu1);
Name = "Form1";
Text = "Form1";
StartPosition = FormStartPosition.CenterScreen;
Text = "Minecraft Modpack Updates Manager";
((System.ComponentModel.ISupportInitialize)radSplitContainer1).EndInit();
radSplitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)splitPanel1).EndInit();
splitPanel1.ResumeLayout(false);
tableLayoutPanel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)radTreeView_Updates).EndInit();
((System.ComponentModel.ISupportInitialize)splitPanel2).EndInit();
splitPanel2.ResumeLayout(false);
tableLayoutPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)radGridView_Actions.MasterTemplate).EndInit();
((System.ComponentModel.ISupportInitialize)radGridView_Actions).EndInit();
((System.ComponentModel.ISupportInitialize)radMenu1).EndInit();
((System.ComponentModel.ISupportInitialize)this).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
@@ -101,4 +206,12 @@ partial class Form1
private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1;
private Telerik.WinControls.UI.SplitPanel splitPanel1;
private Telerik.WinControls.UI.SplitPanel splitPanel2;
private Telerik.WinControls.UI.RadTreeView radTreeView_Updates;
private Telerik.WinControls.UI.RadMenu radMenu1;
private Telerik.WinControls.UI.RadMenuItem radMenuItem1;
private Telerik.WinControls.UI.RadMenuItem radMenuItem_OpenWorkspace;
private Telerik.WinControls.UI.RadMenuItem radMenuItem2;
private TableLayoutPanel tableLayoutPanel2;
private TableLayoutPanel tableLayoutPanel1;
private Telerik.WinControls.UI.RadGridView radGridView_Actions;
}

View File

@@ -9,8 +9,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pilz.Plugins.Advanced" Version="2.10.1" />
<PackageReference Include="Pilz.Plugins.Advanced.UI" Version="1.7.0" />
<PackageReference Include="Pilz.Plugins.Advanced.UI.Telerik" Version="1.7.0" />
<PackageReference Include="Pilz.UI.Telerik" Version="2.7.2" />
<PackageReference Include="UI.for.WinForms.Common" Version="2024.3.806" />
<PackageReference Include="UI.for.WinForms.GridView" Version="2024.3.806" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,3 +1,5 @@
using Pilz.Plugins.Advanced;
namespace ModpackUpdater.Apps.Manager;
internal static class Program
@@ -12,6 +14,7 @@ internal static class Program
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
AppGlobals.Initialize();
PluginFeatureController.Instance.RegisterAllOwn();
Application.Run(new Form1());
}
}