add/edit/delete updates
This commit is contained in:
350
ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs
generated
Normal file
350
ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,350 @@
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Ui;
|
||||
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
var tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition();
|
||||
var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer();
|
||||
splitPanel1 = new Telerik.WinControls.UI.SplitPanel();
|
||||
tableLayoutPanel2 = new TableLayoutPanel();
|
||||
radListControl_Updates = new Telerik.WinControls.UI.RadListControl();
|
||||
splitPanel2 = new Telerik.WinControls.UI.SplitPanel();
|
||||
tableLayoutPanel1 = new TableLayoutPanel();
|
||||
radGridView_Actions = new Telerik.WinControls.UI.RadGridView();
|
||||
radMenuItem_Workspace = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_WorkspacePreferences = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_SaveWorkspace = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuSeparatorItem1 = new Telerik.WinControls.UI.RadMenuSeparatorItem();
|
||||
radMenuItem_OpenNewWorkspace = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_RecentWorkspaces = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_Tools = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenu1 = new Telerik.WinControls.UI.RadMenu();
|
||||
radMenuItem_Updates = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_EditUpdate = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuSeparatorItem2 = new Telerik.WinControls.UI.RadMenuSeparatorItem();
|
||||
radMenuItem_CreateUpdate = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radMenuItem_RemoveUpdate = new Telerik.WinControls.UI.RadMenuItem();
|
||||
radWaitingBar_Updates = new Telerik.WinControls.UI.RadWaitingBar();
|
||||
dotsRingWaitingBarIndicatorElement1 = new Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement();
|
||||
radWaitingBar_Actions = new Telerik.WinControls.UI.RadWaitingBar();
|
||||
dotsRingWaitingBarIndicatorElement2 = new Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement();
|
||||
((System.ComponentModel.ISupportInitialize)radSplitContainer1).BeginInit();
|
||||
radSplitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)splitPanel1).BeginInit();
|
||||
splitPanel1.SuspendLayout();
|
||||
tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)radListControl_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)radWaitingBar_Updates).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radWaitingBar_Actions).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)this).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// radSplitContainer1
|
||||
//
|
||||
radSplitContainer1.Controls.Add(splitPanel1);
|
||||
radSplitContainer1.Controls.Add(splitPanel2);
|
||||
radSplitContainer1.Dock = DockStyle.Fill;
|
||||
radSplitContainer1.Location = new Point(0, 28);
|
||||
radSplitContainer1.Name = "radSplitContainer1";
|
||||
//
|
||||
//
|
||||
//
|
||||
radSplitContainer1.RootElement.MinSize = new Size(25, 25);
|
||||
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(200, 422);
|
||||
splitPanel1.SizeInfo.AutoSizeScale = new SizeF(-0.190954775F, 0F);
|
||||
splitPanel1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute;
|
||||
splitPanel1.SizeInfo.SplitterCorrection = new Size(-152, 0);
|
||||
splitPanel1.TabIndex = 0;
|
||||
splitPanel1.TabStop = false;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
tableLayoutPanel2.ColumnCount = 1;
|
||||
tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||
tableLayoutPanel2.Controls.Add(radListControl_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(200, 422);
|
||||
tableLayoutPanel2.TabIndex = 1;
|
||||
//
|
||||
// radListControl_Updates
|
||||
//
|
||||
radListControl_Updates.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
radListControl_Updates.ItemHeight = 24;
|
||||
radListControl_Updates.Location = new Point(3, 3);
|
||||
radListControl_Updates.Name = "radListControl_Updates";
|
||||
radListControl_Updates.Size = new Size(194, 416);
|
||||
radListControl_Updates.TabIndex = 0;
|
||||
radListControl_Updates.SelectedIndexChanged += RadListControl_Updates_SelectedIndexChanged;
|
||||
//
|
||||
// splitPanel2
|
||||
//
|
||||
splitPanel2.Controls.Add(tableLayoutPanel1);
|
||||
splitPanel2.Location = new Point(204, 0);
|
||||
splitPanel2.Name = "splitPanel2";
|
||||
//
|
||||
//
|
||||
//
|
||||
splitPanel2.RootElement.MinSize = new Size(25, 25);
|
||||
splitPanel2.Size = new Size(596, 422);
|
||||
splitPanel2.SizeInfo.AutoSizeScale = new SizeF(0.190954745F, 0F);
|
||||
splitPanel2.SizeInfo.SplitterCorrection = new Size(152, 0);
|
||||
splitPanel2.TabIndex = 1;
|
||||
splitPanel2.TabStop = false;
|
||||
//
|
||||
// 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(596, 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.AllowAddNewRow = false;
|
||||
radGridView_Actions.MasterTemplate.AllowColumnChooser = false;
|
||||
radGridView_Actions.MasterTemplate.AllowDeleteRow = false;
|
||||
radGridView_Actions.MasterTemplate.AllowDragToGroup = false;
|
||||
radGridView_Actions.MasterTemplate.AllowRowResize = false;
|
||||
radGridView_Actions.MasterTemplate.AllowSearchRow = true;
|
||||
radGridView_Actions.MasterTemplate.EnableGrouping = false;
|
||||
radGridView_Actions.MasterTemplate.ViewDefinition = tableViewDefinition1;
|
||||
radGridView_Actions.Name = "radGridView_Actions";
|
||||
radGridView_Actions.Size = new Size(590, 416);
|
||||
radGridView_Actions.TabIndex = 0;
|
||||
radGridView_Actions.CellFormatting += RadGridView_Actions_CellFormatting;
|
||||
radGridView_Actions.CellValueChanged += RadGridView_Actions_CellValueChanged;
|
||||
//
|
||||
// radMenuItem_Workspace
|
||||
//
|
||||
radMenuItem_Workspace.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_WorkspacePreferences, radMenuItem_SaveWorkspace, radMenuSeparatorItem1, radMenuItem_OpenNewWorkspace, radMenuItem_RecentWorkspaces });
|
||||
radMenuItem_Workspace.Name = "radMenuItem_Workspace";
|
||||
radMenuItem_Workspace.Text = "Workspace";
|
||||
//
|
||||
// radMenuItem_WorkspacePreferences
|
||||
//
|
||||
radMenuItem_WorkspacePreferences.Name = "radMenuItem_WorkspacePreferences";
|
||||
radMenuItem_WorkspacePreferences.Text = "Preferences";
|
||||
radMenuItem_WorkspacePreferences.Click += this.RadMenuItem_WorkspacePreferences_Click;
|
||||
//
|
||||
// radMenuItem_SaveWorkspace
|
||||
//
|
||||
radMenuItem_SaveWorkspace.Name = "radMenuItem_SaveWorkspace";
|
||||
radMenuItem_SaveWorkspace.Text = "Save";
|
||||
//
|
||||
// radMenuSeparatorItem1
|
||||
//
|
||||
radMenuSeparatorItem1.Name = "radMenuSeparatorItem1";
|
||||
radMenuSeparatorItem1.Text = "radMenuSeparatorItem1";
|
||||
radMenuSeparatorItem1.TextAlignment = ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// radMenuItem_OpenNewWorkspace
|
||||
//
|
||||
radMenuItem_OpenNewWorkspace.Name = "radMenuItem_OpenNewWorkspace";
|
||||
radMenuItem_OpenNewWorkspace.Text = "Open new workspace";
|
||||
//
|
||||
// radMenuItem_RecentWorkspaces
|
||||
//
|
||||
radMenuItem_RecentWorkspaces.Name = "radMenuItem_RecentWorkspaces";
|
||||
radMenuItem_RecentWorkspaces.Text = "Recent workspaces";
|
||||
//
|
||||
// radMenuItem_Tools
|
||||
//
|
||||
radMenuItem_Tools.Name = "radMenuItem_Tools";
|
||||
radMenuItem_Tools.Text = "Tools";
|
||||
//
|
||||
// radMenu1
|
||||
//
|
||||
radMenu1.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_Workspace, radMenuItem_Updates, radMenuItem_Tools });
|
||||
radMenu1.Location = new Point(0, 0);
|
||||
radMenu1.Name = "radMenu1";
|
||||
radMenu1.Size = new Size(800, 28);
|
||||
radMenu1.TabIndex = 1;
|
||||
//
|
||||
// radMenuItem_Updates
|
||||
//
|
||||
radMenuItem_Updates.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_EditUpdate, radMenuSeparatorItem2, radMenuItem_CreateUpdate, radMenuItem_RemoveUpdate });
|
||||
radMenuItem_Updates.Name = "radMenuItem_Updates";
|
||||
radMenuItem_Updates.Text = "Updates";
|
||||
radMenuItem_Updates.DropDownOpening += RadMenuItem_Updates_DropDownOpening;
|
||||
//
|
||||
// radMenuItem_EditUpdate
|
||||
//
|
||||
radMenuItem_EditUpdate.Name = "radMenuItem_EditUpdate";
|
||||
radMenuItem_EditUpdate.Text = "Edit";
|
||||
radMenuItem_EditUpdate.Click += RadMenuItem_EditUpdate_Click;
|
||||
//
|
||||
// radMenuSeparatorItem2
|
||||
//
|
||||
radMenuSeparatorItem2.Name = "radMenuSeparatorItem2";
|
||||
radMenuSeparatorItem2.Text = "radMenuSeparatorItem2";
|
||||
radMenuSeparatorItem2.TextAlignment = ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// radMenuItem_CreateUpdate
|
||||
//
|
||||
radMenuItem_CreateUpdate.Name = "radMenuItem_CreateUpdate";
|
||||
radMenuItem_CreateUpdate.Text = "Create";
|
||||
radMenuItem_CreateUpdate.Click += RadMenuItem_CreateUpdate_Click;
|
||||
//
|
||||
// radMenuItem_RemoveUpdate
|
||||
//
|
||||
radMenuItem_RemoveUpdate.Name = "radMenuItem_RemoveUpdate";
|
||||
radMenuItem_RemoveUpdate.Text = "Remove";
|
||||
radMenuItem_RemoveUpdate.Click += RadMenuItem_RemoveUpdate_Click;
|
||||
//
|
||||
// radWaitingBar_Updates
|
||||
//
|
||||
radWaitingBar_Updates.AssociatedControl = radListControl_Updates;
|
||||
radWaitingBar_Updates.Location = new Point(0, 78);
|
||||
radWaitingBar_Updates.Name = "radWaitingBar_Updates";
|
||||
radWaitingBar_Updates.Size = new Size(70, 70);
|
||||
radWaitingBar_Updates.TabIndex = 2;
|
||||
radWaitingBar_Updates.Text = "radWaitingBar1";
|
||||
radWaitingBar_Updates.WaitingIndicators.Add(dotsRingWaitingBarIndicatorElement1);
|
||||
radWaitingBar_Updates.WaitingIndicatorSize = new Size(100, 14);
|
||||
radWaitingBar_Updates.WaitingSpeed = 50;
|
||||
radWaitingBar_Updates.WaitingStyle = Telerik.WinControls.Enumerations.WaitingBarStyles.DotsRing;
|
||||
//
|
||||
// dotsRingWaitingBarIndicatorElement1
|
||||
//
|
||||
dotsRingWaitingBarIndicatorElement1.Name = "dotsRingWaitingBarIndicatorElement1";
|
||||
//
|
||||
// radWaitingBar_Actions
|
||||
//
|
||||
radWaitingBar_Actions.AssociatedControl = radGridView_Actions;
|
||||
radWaitingBar_Actions.Location = new Point(0, 145);
|
||||
radWaitingBar_Actions.Name = "radWaitingBar_Actions";
|
||||
radWaitingBar_Actions.Size = new Size(70, 70);
|
||||
radWaitingBar_Actions.TabIndex = 3;
|
||||
radWaitingBar_Actions.Text = "radWaitingBar2";
|
||||
radWaitingBar_Actions.WaitingIndicators.Add(dotsRingWaitingBarIndicatorElement2);
|
||||
radWaitingBar_Actions.WaitingIndicatorSize = new Size(100, 14);
|
||||
radWaitingBar_Actions.WaitingSpeed = 50;
|
||||
radWaitingBar_Actions.WaitingStyle = Telerik.WinControls.Enumerations.WaitingBarStyles.DotsRing;
|
||||
//
|
||||
// dotsRingWaitingBarIndicatorElement2
|
||||
//
|
||||
dotsRingWaitingBarIndicatorElement2.Name = "dotsRingWaitingBarIndicatorElement2";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleBaseSize = new Size(7, 15);
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(radWaitingBar_Actions);
|
||||
Controls.Add(radWaitingBar_Updates);
|
||||
Controls.Add(radSplitContainer1);
|
||||
Controls.Add(radMenu1);
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "MainForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Minecraft Modpack Updates Manager";
|
||||
WindowState = FormWindowState.Maximized;
|
||||
Load += Form1_Load;
|
||||
((System.ComponentModel.ISupportInitialize)radSplitContainer1).EndInit();
|
||||
radSplitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitPanel1).EndInit();
|
||||
splitPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)radListControl_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)radWaitingBar_Updates).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radWaitingBar_Actions).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)this).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1;
|
||||
private Telerik.WinControls.UI.SplitPanel splitPanel1;
|
||||
private Telerik.WinControls.UI.SplitPanel splitPanel2;
|
||||
private Telerik.WinControls.UI.RadMenu radMenu1;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_Workspace;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_WorkspacePreferences;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_Tools;
|
||||
private TableLayoutPanel tableLayoutPanel2;
|
||||
private TableLayoutPanel tableLayoutPanel1;
|
||||
private Telerik.WinControls.UI.RadGridView radGridView_Actions;
|
||||
private Telerik.WinControls.UI.RadMenuSeparatorItem radMenuSeparatorItem1;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_OpenNewWorkspace;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_RecentWorkspaces;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_SaveWorkspace;
|
||||
private Telerik.WinControls.UI.RadWaitingBar radWaitingBar_Updates;
|
||||
private Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement dotsRingWaitingBarIndicatorElement1;
|
||||
private Telerik.WinControls.UI.RadWaitingBar radWaitingBar_Actions;
|
||||
private Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement dotsRingWaitingBarIndicatorElement2;
|
||||
private Telerik.WinControls.UI.RadListControl radListControl_Updates;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_Updates;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_EditUpdate;
|
||||
private Telerik.WinControls.UI.RadMenuSeparatorItem radMenuSeparatorItem2;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_CreateUpdate;
|
||||
private Telerik.WinControls.UI.RadMenuItem radMenuItem_RemoveUpdate;
|
||||
}
|
||||
513
ModpackUpdater.Apps.Manager/Ui/MainForm.cs
Normal file
513
ModpackUpdater.Apps.Manager/Ui/MainForm.cs
Normal file
@@ -0,0 +1,513 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Model;
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using ModpackUpdater.Apps.Manager.Settings;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||
using Pilz.UI.Extensions;
|
||||
using Pilz.UI.Symbols;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
using Pilz.UI.Telerik.Extensions.Extensions;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Ui;
|
||||
|
||||
public partial class MainForm : RadForm, IMainApi
|
||||
{
|
||||
private WorkspaceTag? wsInfo;
|
||||
|
||||
IWorkspace? IMainApi.Workspace => wsInfo?.Workspace;
|
||||
|
||||
private record RecentFilesItemTag(WorkspaceConfig Config, WorkspaceFeature Feature);
|
||||
|
||||
private record WorkspaceTag(IWorkspace Workspace, WorkspaceFeature Feature);
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
radMenuItem_Workspace.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.workspace, SymbolSize.Small);
|
||||
radMenuItem_WorkspacePreferences.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.settings, SymbolSize.Small);
|
||||
radMenuItem_SaveWorkspace.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.save, SymbolSize.Small);
|
||||
radMenuItem_OpenNewWorkspace.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.new_window, SymbolSize.Small);
|
||||
radMenuItem_RecentWorkspaces.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.time_machine, SymbolSize.Small);
|
||||
radMenuItem_Updates.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.update_done, SymbolSize.Small);
|
||||
radMenuItem_EditUpdate.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small);
|
||||
radMenuItem_CreateUpdate.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.add, SymbolSize.Small);
|
||||
radMenuItem_RemoveUpdate.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.remove, SymbolSize.Small);
|
||||
radMenuItem_Tools.SvgImage = AppGlobals.Symbols.GetSvgImage(AppSymbols.tools, SymbolSize.Small);
|
||||
|
||||
radMenuItem_SaveWorkspace.Shortcuts.Add(new(Keys.Control, Keys.S));
|
||||
|
||||
PluginFeatureController.Instance.Features.Get(FeatureTypes.Workspace).InsertItemsTo(radMenuItem_OpenNewWorkspace.Items, customClickHandler: RadMenuItem_OpenNewWorkspace_Click);
|
||||
PluginFeatureController.Instance.Functions.Get(FeatureTypes.Tools).InsertItemsTo(radMenuItem_OpenNewWorkspace.Items, customClickHandler: RadMenuItem_ToolsItem_Click);
|
||||
}
|
||||
|
||||
private void LoadRecentWorkspaces()
|
||||
{
|
||||
var settings = Program.Settings.Get<WorkspaceSettings>();
|
||||
|
||||
radMenuItem_RecentWorkspaces.Items.Clear();
|
||||
|
||||
foreach (var config in settings.Workspaces.ToArray())
|
||||
{
|
||||
if (PluginFeatureController.Instance.Features.Get(FeatureTypes.Workspace).OfType<WorkspaceFeature>().FirstOrDefault(n => n.Identifier == config.ProviderId) is not WorkspaceFeature feature)
|
||||
{
|
||||
settings.Workspaces.Remove(config);
|
||||
continue;
|
||||
}
|
||||
|
||||
var item = new RadMenuItem
|
||||
{
|
||||
Text = config.DisplayText,
|
||||
Tag = new RecentFilesItemTag(config, feature),
|
||||
SvgImage = feature.Icon as RadSvgImage,
|
||||
};
|
||||
|
||||
item.Click += RadMenuItem_OpenRecentWorkspace_Click;
|
||||
|
||||
radMenuItem_RecentWorkspaces.Items.Add(item);
|
||||
}
|
||||
|
||||
if (radMenuItem_RecentWorkspaces.Items.Any())
|
||||
radMenuItem_RecentWorkspaces.Visibility = ElementVisibility.Visible;
|
||||
else
|
||||
radMenuItem_RecentWorkspaces.Visibility = ElementVisibility.Collapsed;
|
||||
}
|
||||
|
||||
private void AddToRecentFiles(IWorkspace workspace)
|
||||
{
|
||||
var settings = Program.Settings.Get<WorkspaceSettings>();
|
||||
|
||||
settings.Workspaces.Remove(workspace.Config);
|
||||
settings.Workspaces.Insert(0, workspace.Config);
|
||||
|
||||
while (settings.Workspaces.Count > 20)
|
||||
settings.Workspaces.RemoveAt(20);
|
||||
}
|
||||
|
||||
private async Task LoadNewWorkspace(IWorkspace? workspace, WorkspaceFeature feature)
|
||||
{
|
||||
if (workspace is null)
|
||||
return;
|
||||
|
||||
if (workspace != wsInfo?.Workspace)
|
||||
wsInfo = new(workspace, feature);
|
||||
|
||||
AddToRecentFiles(workspace);
|
||||
Invoke(LoadRecentWorkspaces);
|
||||
|
||||
radWaitingBar_Updates.StartWaiting();
|
||||
|
||||
if (!await workspace.Load())
|
||||
{
|
||||
radWaitingBar_Updates.StopWaiting();
|
||||
return;
|
||||
}
|
||||
|
||||
Invoke(LoadWorkspace);
|
||||
}
|
||||
|
||||
private void LoadWorkspace()
|
||||
{
|
||||
if (wsInfo?.Workspace.Config is null || wsInfo.Workspace.InstallInfos is null || wsInfo.Workspace.UpdateInfos is null)
|
||||
return;
|
||||
|
||||
radWaitingBar_Updates.StartWaiting();
|
||||
Text = wsInfo.Workspace.Config.DisplayText;
|
||||
radListControl_Updates.BeginUpdate();
|
||||
radListControl_Updates.Items.Clear();
|
||||
|
||||
AddUpdateItem(wsInfo.Workspace.InstallInfos);
|
||||
wsInfo.Workspace.UpdateInfos.Updates.ForEach(n => AddUpdateItem(n));
|
||||
|
||||
radListControl_Updates.EndUpdate();
|
||||
radWaitingBar_Updates.StopWaiting();
|
||||
}
|
||||
|
||||
private RadListDataItem AddUpdateItem(IActionSetInfos infos)
|
||||
{
|
||||
var item = CreateUpdateItem(infos);
|
||||
radListControl_Updates.Items.Add(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
private RadListDataItem InsertUpdateItem(IActionSetInfos infos)
|
||||
{
|
||||
var item = CreateUpdateItem(infos);
|
||||
radListControl_Updates.Items.Insert(Math.Min(1, radListControl_Updates.Items.Count), item);
|
||||
return item;
|
||||
}
|
||||
|
||||
private RadListDataItem CreateUpdateItem(IActionSetInfos infos)
|
||||
{
|
||||
var item = new RadListDataItem();
|
||||
UpdateUpdateItem(item, infos);
|
||||
return item;
|
||||
}
|
||||
|
||||
private void UpdateUpdateItem(RadListDataItem item)
|
||||
{
|
||||
if (item.Tag is IActionSetInfos infos)
|
||||
UpdateUpdateItem(item, infos);
|
||||
}
|
||||
|
||||
private void UpdateUpdateItem(RadListDataItem item, IActionSetInfos infos)
|
||||
{
|
||||
if (item.Value != infos)
|
||||
item.Value = infos;
|
||||
|
||||
if (infos is UpdateInfo)
|
||||
item.Text = string.Format(GeneralLangRes.Node_Update, infos.Version.ToString());
|
||||
else if (infos is InstallInfos)
|
||||
item.Text = string.Format(GeneralLangRes.Node_Install, infos.Version.ToString());
|
||||
else
|
||||
item.Text = infos.Version.ToString();
|
||||
}
|
||||
|
||||
private void LoadActionSet(IActionSetInfos infos)
|
||||
{
|
||||
radGridView_Actions.BeginUpdate();
|
||||
radGridView_Actions.Rows.Clear();
|
||||
radGridView_Actions.Columns.Clear();
|
||||
|
||||
// Add columns
|
||||
radGridView_Actions.Columns.AddRange([
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "id",
|
||||
HeaderText = ActionsListLangRes.Col_Id,
|
||||
Width = 150,
|
||||
IsVisible = infos is not UpdateInfo,
|
||||
IsPinned = true,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "name",
|
||||
HeaderText = ActionsListLangRes.Col_Name,
|
||||
Width = 150,
|
||||
IsVisible = infos is not UpdateInfo,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "inherit",
|
||||
HeaderText = ActionsListLangRes.Col_InheritFrom,
|
||||
Width = 150,
|
||||
IsVisible = infos is UpdateInfo,
|
||||
IsPinned = true,
|
||||
},
|
||||
new GridViewComboBoxColumn
|
||||
{
|
||||
Name = "utype",
|
||||
HeaderText = ActionsListLangRes.Col_UpdateType,
|
||||
Width = 150,
|
||||
DataSource = Enum.GetValues<UpdateActionType>(),
|
||||
IsVisible = infos is UpdateInfo,
|
||||
},
|
||||
new GridViewComboBoxColumn
|
||||
{
|
||||
Name = "side",
|
||||
HeaderText = ActionsListLangRes.Col_Side,
|
||||
Width = 100,
|
||||
DataSource = Enum.GetValues<Side>(),
|
||||
},
|
||||
new GridViewCheckBoxColumn
|
||||
{
|
||||
Name = "isextra",
|
||||
HeaderText = ActionsListLangRes.Col_IsExtra,
|
||||
Width = 50,
|
||||
},
|
||||
new GridViewCheckBoxColumn
|
||||
{
|
||||
Name = "iszip",
|
||||
HeaderText = ActionsListLangRes.Col_IsZip,
|
||||
Width = 50,
|
||||
},
|
||||
new GridViewCheckBoxColumn
|
||||
{
|
||||
Name = "isdir",
|
||||
HeaderText = ActionsListLangRes.Col_IsDir,
|
||||
Width = 50,
|
||||
IsVisible = infos is UpdateInfo,
|
||||
},
|
||||
new GridViewComboBoxColumn
|
||||
{
|
||||
Name = "srctype",
|
||||
HeaderText = ActionsListLangRes.Col_SrcType,
|
||||
Width = 150,
|
||||
DataSource = Enum.GetValues<SourceType>(),
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srcowner",
|
||||
HeaderText = ActionsListLangRes.Col_SrcOwner,
|
||||
Width = 150,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srcname",
|
||||
HeaderText = ActionsListLangRes.Col_SrcName,
|
||||
Width = 150,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srcregex",
|
||||
HeaderText = ActionsListLangRes.Col_SrcRegEx,
|
||||
Width = 200,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srctag",
|
||||
HeaderText = ActionsListLangRes.Col_SrcTag,
|
||||
Width = 150,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srcurl",
|
||||
HeaderText = ActionsListLangRes.Col_SrcUrl,
|
||||
Width = 350,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "zippath",
|
||||
HeaderText = ActionsListLangRes.Col_ZipPath,
|
||||
Width = 200,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "srcpath",
|
||||
HeaderText = ActionsListLangRes.Col_SrcPath,
|
||||
Width = 250,
|
||||
IsVisible = infos is UpdateInfo,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "destpath",
|
||||
HeaderText = ActionsListLangRes.Col_DestPath,
|
||||
Width = 250,
|
||||
},
|
||||
new GridViewTextBoxColumn
|
||||
{
|
||||
Name = "website",
|
||||
HeaderText = ActionsListLangRes.Col_Website,
|
||||
Width = 350,
|
||||
},
|
||||
]);
|
||||
|
||||
// Add rows
|
||||
foreach (var action in infos.Actions)
|
||||
{
|
||||
var row = radGridView_Actions.Rows.AddNew();
|
||||
row.Tag = action;
|
||||
row.Cells["id"].Value = action.Id;
|
||||
row.Cells["name"].Value = action.Name;
|
||||
row.Cells["iszip"].Value = action.IsZip;
|
||||
row.Cells["zippath"].Value = action.ZipPath;
|
||||
row.Cells["destpath"].Value = action.DestPath;
|
||||
row.Cells["srcurl"].Value = action.SourceUrl;
|
||||
row.Cells["srctype"].Value = action.SourceType;
|
||||
row.Cells["srcowner"].Value = action.SourceOwner;
|
||||
row.Cells["srcname"].Value = action.SourceName;
|
||||
row.Cells["srcregex"].Value = action.SourceRegex;
|
||||
row.Cells["srctag"].Value = action.SourceTag;
|
||||
row.Cells["side"].Value = action.Side;
|
||||
row.Cells["isextra"].Value = action.IsExtra;
|
||||
|
||||
if (action is UpdateAction uaction)
|
||||
{
|
||||
row.Cells["inherit"].Value = uaction.InheritFrom; // TODO: Find inherit action and put it in here!
|
||||
row.Cells["utype"].Value = uaction.Type;
|
||||
row.Cells["srcpath"].Value = uaction.SrcPath;
|
||||
row.Cells["isdir"].Value = uaction.IsDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
radGridView_Actions.EndUpdate();
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadRecentWorkspaces();
|
||||
}
|
||||
|
||||
private async void RadMenuItem_OpenNewWorkspace_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is RadMenuItem item && item.Tag is WorkspaceFeature feature)
|
||||
{
|
||||
var ws = wsInfo?.Workspace;
|
||||
if (feature.Configure(ref ws))
|
||||
await LoadNewWorkspace(ws, feature);
|
||||
}
|
||||
}
|
||||
|
||||
private async void RadMenuItem_OpenRecentWorkspace_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is RadMenuItem item && item.Tag is RecentFilesItemTag tag && tag.Feature.CreateFromConfig(tag.Config) is IWorkspace workspace)
|
||||
await LoadNewWorkspace(workspace, tag.Feature);
|
||||
}
|
||||
|
||||
private async void RadMenuItem_WorkspacePreferences_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (wsInfo != null)
|
||||
{
|
||||
var ws = wsInfo.Workspace;
|
||||
if (wsInfo.Feature.Configure(ref ws))
|
||||
await LoadNewWorkspace(ws, wsInfo.Feature);
|
||||
}
|
||||
}
|
||||
|
||||
private void RadMenuItem_ToolsItem_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is RadMenuItem item && item.Tag is PluginFunction func)
|
||||
func.Execute(new MainApiParameters(this));
|
||||
}
|
||||
|
||||
private void RadListControl_Updates_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
|
||||
{
|
||||
if (radListControl_Updates.Items.ElementAtOrDefault(e.Position)?.Value is IActionSetInfos infos)
|
||||
LoadActionSet(infos);
|
||||
}
|
||||
|
||||
private void RadGridView_Actions_CellFormatting(object sender, CellFormattingEventArgs e)
|
||||
{
|
||||
//var cellElement = e.CellElement;
|
||||
//var cellInfo = e.Row.Cells[e.Column.Name];
|
||||
|
||||
//if (e.Column.Name == "srctype" && cellInfo?.Value is string sourceTypeStr && Enum.Parse<SourceType>(sourceTypeStr) is SourceType sourceType)
|
||||
//{
|
||||
// cellElement.SvgImage = sourceType switch
|
||||
// {
|
||||
// SourceType.DirectLink => AppGlobals.Symbols.GetSvgImage(AppSymbols.link, SymbolSize.Small),
|
||||
// SourceType.GitHub => AppGlobals.Symbols.GetSvgImage(AppSymbols.github, SymbolSize.Small),
|
||||
// _ => null,
|
||||
// };
|
||||
// cellElement.DrawImage = cellElement.SvgImage != null;
|
||||
// cellElement.TextImageRelation = TextImageRelation.ImageBeforeText;
|
||||
// cellElement.ImageAlignment = ContentAlignment.MiddleLeft;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// cellElement.ResetValue(LightVisualElement.SvgImageProperty, ValueResetFlags.Local);
|
||||
// cellElement.ResetValue(LightVisualElement.DrawImageProperty, ValueResetFlags.Local);
|
||||
// cellElement.ResetValue(LightVisualElement.TextImageRelationProperty, ValueResetFlags.Local);
|
||||
// cellElement.ResetValue(LightVisualElement.ImageAlignmentProperty, ValueResetFlags.Local);
|
||||
//}
|
||||
}
|
||||
|
||||
private void RadGridView_Actions_CellValueChanged(object sender, GridViewCellEventArgs e)
|
||||
{
|
||||
if (e.Row?.Tag is not InstallAction action)
|
||||
return;
|
||||
|
||||
var uaction = action as UpdateAction;
|
||||
var newValue = e.Row.Cells[e.Column.Name].Value;
|
||||
var colName = e.Column.Name;
|
||||
|
||||
if (newValue is string valueStr)
|
||||
{
|
||||
var valueNullStr = valueStr.Nullify();
|
||||
|
||||
switch (colName)
|
||||
{
|
||||
case "id":
|
||||
action.Id = valueNullStr;
|
||||
break;
|
||||
case "name":
|
||||
action.Name = valueNullStr;
|
||||
break;
|
||||
case "zippath":
|
||||
action.ZipPath = valueNullStr;
|
||||
break;
|
||||
case "destpath":
|
||||
action.DestPath = valueNullStr;
|
||||
break;
|
||||
case "srcurl":
|
||||
action.SourceUrl = valueNullStr;
|
||||
break;
|
||||
case "srctype":
|
||||
action.SourceType = Enum.Parse<SourceType>(valueStr);
|
||||
break;
|
||||
case "srcowner":
|
||||
action.SourceOwner = valueNullStr;
|
||||
break;
|
||||
case "srcname":
|
||||
action.SourceName = valueNullStr;
|
||||
break;
|
||||
case "srcregex":
|
||||
action.SourceTag = valueNullStr;
|
||||
break;
|
||||
case "srctag":
|
||||
action.SourceTag = valueNullStr;
|
||||
break;
|
||||
case "side":
|
||||
action.Side = Enum.Parse<Side>(valueStr);
|
||||
break;
|
||||
case "inherit":
|
||||
if (uaction is not null)
|
||||
uaction.InheritFrom = valueNullStr;
|
||||
break;
|
||||
case "utype":
|
||||
if (uaction is not null)
|
||||
uaction.Type = Enum.Parse<UpdateActionType>(valueStr);
|
||||
break;
|
||||
case "srcpath":
|
||||
if (uaction is not null)
|
||||
uaction.SrcPath = valueNullStr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (newValue is bool valueBool)
|
||||
{
|
||||
switch (colName)
|
||||
{
|
||||
case "iszip":
|
||||
action.IsZip = valueBool;
|
||||
break;
|
||||
case "isextra":
|
||||
action.IsExtra = valueBool;
|
||||
break;
|
||||
case "isdir":
|
||||
if (uaction is not null)
|
||||
uaction.IsDirectory = valueBool;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RadMenuItem_Updates_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
radMenuItem_EditUpdate.Enabled = radListControl_Updates.SelectedItem?.Value is IActionSetInfos;
|
||||
radMenuItem_RemoveUpdate.Enabled = radListControl_Updates.SelectedItem?.Value is UpdateInfo;
|
||||
}
|
||||
|
||||
private void RadMenuItem_EditUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (radListControl_Updates.SelectedItem?.Value is IActionSetInfos infos
|
||||
&& RadDialogBase.Show(new UpdatePropertiesEditorFlyout(infos), TitlesLangRes.EditUpdate, AppGlobals.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small)).IsValid())
|
||||
UpdateUpdateItem(radListControl_Updates.SelectedItem);
|
||||
}
|
||||
|
||||
private void RadMenuItem_CreateUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var infos = new UpdateInfo();
|
||||
|
||||
if (wsInfo?.Workspace.UpdateInfos is not null
|
||||
&& RadDialogBase.Show(new UpdatePropertiesEditorFlyout(infos), TitlesLangRes.EditUpdate, AppGlobals.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small)).IsValid())
|
||||
{
|
||||
wsInfo.Workspace.UpdateInfos.Updates.Insert(0, infos);
|
||||
InsertUpdateItem(infos);
|
||||
}
|
||||
}
|
||||
|
||||
private void RadMenuItem_RemoveUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (radListControl_Updates.SelectedItem?.Value is UpdateInfo infos && wsInfo?.Workspace.UpdateInfos is not null
|
||||
&& RadMessageBox.Show(MsgBoxLangRes.RemoveUpdate, MsgBoxLangRes.RemoveUpdate_Title, MessageBoxButtons.YesNo, RadMessageIcon.Exclamation).IsOk())
|
||||
{
|
||||
wsInfo.Workspace.UpdateInfos.Updates.Remove(infos);
|
||||
radListControl_Updates.Items.Remove(radListControl_Updates.SelectedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
1787
ModpackUpdater.Apps.Manager/Ui/MainForm.resx
Normal file
1787
ModpackUpdater.Apps.Manager/Ui/MainForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
99
ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs
generated
Normal file
99
ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
namespace ModpackUpdater.Apps.Manager.Ui;
|
||||
|
||||
partial class UpdatePropertiesEditorFlyout
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
tableLayoutPanel1 = new TableLayoutPanel();
|
||||
radLabel1 = new Telerik.WinControls.UI.RadLabel();
|
||||
radTextBox_Version = new Telerik.WinControls.UI.RadTextBox();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radTextBox_Version).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
tableLayoutPanel1.AutoSize = true;
|
||||
tableLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableLayoutPanel1.ColumnCount = 1;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Controls.Add(radLabel1, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(radTextBox_Version, 0, 1);
|
||||
tableLayoutPanel1.Dock = DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new Point(0, 30);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 3;
|
||||
tableLayoutPanel1.RowStyles.Add(new RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Size = new Size(300, 58);
|
||||
tableLayoutPanel1.TabIndex = 4;
|
||||
//
|
||||
// radLabel1
|
||||
//
|
||||
radLabel1.Location = new Point(3, 3);
|
||||
radLabel1.Name = "radLabel1";
|
||||
radLabel1.Size = new Size(55, 22);
|
||||
radLabel1.TabIndex = 0;
|
||||
radLabel1.Text = "Version";
|
||||
//
|
||||
// radTextBox_Version
|
||||
//
|
||||
radTextBox_Version.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
radTextBox_Version.Location = new Point(3, 31);
|
||||
radTextBox_Version.Name = "radTextBox_Version";
|
||||
radTextBox_Version.NullText = "1.5.37.0";
|
||||
radTextBox_Version.Size = new Size(294, 24);
|
||||
radTextBox_Version.TabIndex = 1;
|
||||
//
|
||||
// UpdatePropertiesEditorFlyout
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
BackColor = Color.Transparent;
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
MinimumSize = new Size(300, 0);
|
||||
Name = "UpdatePropertiesEditorFlyout";
|
||||
Size = new Size(300, 118);
|
||||
Controls.SetChildIndex(tableLayoutPanel1, 0);
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radTextBox_Version).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private TableLayoutPanel tableLayoutPanel1;
|
||||
private Telerik.WinControls.UI.RadLabel radLabel1;
|
||||
private Telerik.WinControls.UI.RadTextBox radTextBox_Version;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Pilz.UI;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Ui;
|
||||
|
||||
public partial class UpdatePropertiesEditorFlyout : RadFlyoutBase, ILoadContent
|
||||
{
|
||||
private readonly IActionSetInfos infos;
|
||||
|
||||
public UpdatePropertiesEditorFlyout(IActionSetInfos infos)
|
||||
{
|
||||
this.infos = infos;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void LoadContent()
|
||||
{
|
||||
radTextBox_Version.Text = infos.Version.ToString();
|
||||
}
|
||||
|
||||
protected override bool ValidateOK()
|
||||
{
|
||||
if (!Version.TryParse(radTextBox_Version.Text.Trim(), out Version? version))
|
||||
return false;
|
||||
|
||||
infos.Version = version;
|
||||
|
||||
return base.ValidateOK();
|
||||
}
|
||||
}
|
||||
120
ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx
Normal file
120
ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx
Normal 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>
|
||||
Reference in New Issue
Block a user