Work on extra GUI app

This commit is contained in:
JustArchi
2016-03-20 05:27:30 +01:00
parent 0387eb3746
commit 2b3a5ff337
21 changed files with 1270 additions and 13 deletions

View File

@@ -0,0 +1,51 @@
using System.IO;
using System.Windows.Forms;
namespace ConfigGenerator {
internal sealed class GlobalConfigPage : TabPage {
internal GlobalConfig GlobalConfig { get; private set; }
private EnhancedPropertyGrid EnhancedPropertyGrid;
internal GlobalConfigPage(string filePath) : base() {
if (string.IsNullOrEmpty(filePath)) {
return;
}
GlobalConfig = GlobalConfig.Load(filePath);
if (GlobalConfig == null) {
Logging.LogNullError("GlobalConfig");
return;
}
Text = Path.GetFileNameWithoutExtension(filePath);
EnhancedPropertyGrid = new EnhancedPropertyGrid(GlobalConfig);
Controls.Add(EnhancedPropertyGrid);
Panel panel = new Panel() {
Height = 20,
Dock = DockStyle.Bottom,
};
panel.Controls.Add(new Button() {
Dock = DockStyle.Left,
Text = "Load"
});
panel.Controls.Add(new Button() {
Dock = DockStyle.Right,
Text = "Save"
});
Controls.Add(panel);
}
private void InitializeComponent() {
this.SuspendLayout();
this.ResumeLayout(false);
}
}
}