void Ti_EditorWatchTick(object sender, EventArgs e) { if (modEditor.Visible == false) { // disable timer ti_EditorWatch.Enabled = false; // HIER MÜSSEN ÜBERGEBENE DATEN BEHANDELT WERDEN SOFERN WELCHE ÜBERGEBEN WURDEN if (modEditor.NewData) { ModList.Lvi_Modlist.Add(modEditor.LviModData); ModList.SaveMods(); LoadItemsToListView(); } if (modEditor.EditedData) { // search the correct item in the modlist and overwrite it for (int i = 0; i < ModList.Lvi_Modlist.Count; i++) { if (ModList.Lvi_Modlist[i].SubItems[0].Text == modEditor.LviModData.SubItems[0].Text) { ModList.Lvi_Modlist[i] = modEditor.LviModData; ModList.SaveMods(); LoadItemsToListView(); } } } // delete active modEditor object and enable main form modEditor = null; this.BringToFront(); this.Enabled = true; } }
void Btn_NewModClick(object sender, EventArgs e) { if (modEditor == null) { modEditor = new ModEditor(ModList.GetNextID); modEditor.Show(); modEditor.BringToFront(); this.Enabled = false; ti_EditorWatch.Enabled = true; } }
void Btn_EditModClick(object sender, EventArgs e) { // check if item is selected befor starting some action if (lv_ModList.SelectedItems.Count > 0) { // search selected entry in modlist List // start modeditor with selected modlist List item modEditor = new ModEditor(lv_ModList.SelectedItems[0]); // start timer and disable form modEditor.Show(); modEditor.BringToFront(); this.Enabled = false; ti_EditorWatch.Enabled = true; } }