Update addMeta

This commit is contained in:
miku-666
2022-06-10 12:34:34 +02:00
parent 6ade4b3f75
commit 30f43291e9
2 changed files with 12 additions and 8 deletions

View File

@@ -72,13 +72,11 @@
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ControlBox = false;
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "addMeta";

View File

@@ -13,20 +13,26 @@ namespace PckStudio
{
public partial class addMeta : MetroFramework.Forms.MetroForm
{
PCKFile.FileData file;
public addMeta(PCKFile.FileData fileIn)
public string PropertyName => textBox1.Text;
public string PropertyValue => textBox2.Text;
public addMeta(string name, string value)
{
InitializeComponent();
textBox1.Text = name;
textBox2.Text = value;
}
public addMeta()
{
InitializeComponent();
file = fileIn;
FormBorderStyle = FormBorderStyle.None;
}
private void button1_Click(object sender, EventArgs e)
{
file.properties.Add(new ValueTuple<string, string>(textBox1.Text, textBox2.Text ));
DialogResult = DialogResult.OK;
Close();
}
}
}
}