Начата разработка редактора конфигов

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-03-28 20:20:52 +07:00
parent 116e4cb28f
commit 6ad64eb92c
7 changed files with 197 additions and 56 deletions

View File

@@ -46,14 +46,17 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@@ -1,40 +0,0 @@
namespace ConfigEditor
{
partial class Form1
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@@ -1,12 +0,0 @@
using System.Windows.Forms;
namespace ConfigEditor
{
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
}
}
}

160
ConfigEditor/MainForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,160 @@
namespace ConfigEditor
{
partial class MainForm
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.открытьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.сохранитьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.сохранитьКакToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.сгенерироватьMD5ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.закрытьФайлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.закрытьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.richTextBox1.Location = new System.Drawing.Point(0, 24);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(800, 426);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.файлToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(800, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// файлToolStripMenuItem
//
this.файлToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.открытьToolStripMenuItem,
this.сохранитьToolStripMenuItem,
this.сохранитьКакToolStripMenuItem,
this.toolStripSeparator1,
this.сгенерироватьMD5ToolStripMenuItem,
this.toolStripSeparator2,
this.закрытьФайлToolStripMenuItem,
this.закрытьToolStripMenuItem});
this.файлToolStripMenuItem.Name = айлToolStripMenuItem";
this.файлToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
this.файлToolStripMenuItem.Text = "Файл";
//
// открытьToolStripMenuItem
//
this.открытьToolStripMenuItem.Name = "открытьToolStripMenuItem";
this.открытьToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.открытьToolStripMenuItem.Text = "Открыть";
this.открытьToolStripMenuItem.Click += new System.EventHandler(this.открытьToolStripMenuItem_Click);
//
// сохранитьToolStripMenuItem
//
this.сохранитьToolStripMenuItem.Name = "сохранитьToolStripMenuItem";
this.сохранитьToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.сохранитьToolStripMenuItem.Text = "Сохранить";
//
// сохранитьКакToolStripMenuItem
//
this.сохранитьКакToolStripMenuItem.Name = "сохранитьКакToolStripMenuItem";
this.сохранитьКакToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.сохранитьКакToolStripMenuItem.Text = "Сохранить как...";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(182, 6);
//
// сгенерироватьMD5ToolStripMenuItem
//
this.сгенерироватьMD5ToolStripMenuItem.Name = "сгенерироватьMD5ToolStripMenuItem";
this.сгенерироватьMD5ToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.сгенерироватьMD5ToolStripMenuItem.Text = "Сгенерировать MD5";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(182, 6);
//
// закрытьФайлToolStripMenuItem
//
this.закрытьФайлToolStripMenuItem.Name = акрытьФайлToolStripMenuItem";
this.закрытьФайлToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.закрытьФайлToolStripMenuItem.Text = "Закрыть файл";
//
// закрытьToolStripMenuItem
//
this.закрытьToolStripMenuItem.Name = акрытьToolStripMenuItem";
this.закрытьToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.закрытьToolStripMenuItem.Text = "Закрыть";
this.закрытьToolStripMenuItem.Click += new System.EventHandler(this.закрытьToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "SaveWizard Config Editor";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem открытьToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem сохранитьToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem сохранитьКакToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem сгенерироватьMD5ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem закрытьФайлToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem закрытьToolStripMenuItem;
}
}

30
ConfigEditor/MainForm.cs Normal file
View File

@@ -0,0 +1,30 @@
using System.IO;
using System.Windows.Forms;
namespace ConfigEditor
{
public partial class MainForm: Form
{
public MainForm()
{
InitializeComponent();
}
private void открытьToolStripMenuItem_Click(object sender, System.EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog()
{
Title = "Выберите файл конфигурации",
Filter = "Файл *.json|*.json",
Multiselect = false
};
if (ofd.ShowDialog() == DialogResult.OK)
richTextBox1.Text = File.ReadAllText(ofd.FileName);
}
private void закрытьToolStripMenuItem_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}

View File

@@ -16,7 +16,7 @@ namespace ConfigEditor
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainForm());
}
}
}