public Form1() { InitializeComponent(); FormAdministrator.main = this; SectionAdministrator.Load(); if (SectionBox.TabPages.Count != 0) { FormAdministrator.CurrentFolder = SectionBox.TabPages[0].Text; } ActionAdministrator.Load(); EventsAdministrator.Load(); }
private void button1_Click(object sender, EventArgs e) { Section section = new Section(textBox1.Text, textBox2.Text, textBox3.Text); SectionAdministrator.AddSection(section); Directory.CreateDirectory(FormAdministrator.SectionsFolder + section.Name); BinaryFormatter formatter = new BinaryFormatter(); using (FileStream fs = new FileStream(FormAdministrator.SectionsFolder + section.Name + "/section.bin", FileMode.OpenOrCreate)) { formatter.Serialize(fs, section); } this.Close(); }