private void EditButton_Click(object sender, EventArgs e)
 {
     using (var modEditor = new ModuleEntryEditor(tempModuleEntries[ModuleList.SelectedIndex]))
     {
         modEditor.ShowDialog();
         if (modEditor.EditedModule != null)
         {
             tempModuleEntries[ModuleList.SelectedIndex] = modEditor.EditedModule;
         }
     }
     RefreshUi();
 }
 private void AddButton_Click(object sender, EventArgs e)
 {
     using (var modEditor = new ModuleEntryEditor(EmptyModuleEntry))
     {
         modEditor.ShowDialog();
         if (modEditor.EditedModule != null)
         {
             tempModuleEntries.Add(modEditor.EditedModule);
             ModuleList.Items.Add(modEditor.EditedModule["name"]);
         }
     }
     RefreshUi();
 }