private void btnLoadStockpile_Click(object sender, EventArgs e) { try { GlobalWin.Sound.StopSound(); RTC_RPC.SendToKillSwitch("FREEZE"); Stockpile.Load(); } finally { RTC_RPC.SendToKillSwitch("UNFREEZE"); GlobalWin.Sound.StartSound(); } RTC_Restore.SaveRestore(); }
private void btnLoadStockpile_MouseDown(object sender, MouseEventArgs e) { Point locate = new Point((sender as Control).Location.X + e.Location.X, (sender as Control).Location.Y + e.Location.Y); ContextMenuStrip LoadMenuItems = new ContextMenuStrip(); LoadMenuItems.Items.Add("Load Stockpile", null, new EventHandler((ob, ev) => { try { DontLoadSelectedStockpile = true; Stockpile.Load(dgvStockpile); dgvStockpile.ClearSelection(); RTC_Core.ghForm.dgvStockpile.Rows.Clear(); } catch (Exception ex) { MessageBox.Show("Loading Failure ->\n\n" + ex.ToString()); } })); LoadMenuItems.Items.Add("Load Bizhawk settings from Stockpile", null, new EventHandler((ob, ev) => { try { Stockpile.LoadBizhawkConfigFromStockpile(); } catch (Exception ex) { MessageBox.Show("Loading Settings Failure ->\n\n" + ex.ToString()); } })); LoadMenuItems.Items.Add("Restore Bizhawk config Backup", null, new EventHandler((ob, ev) => { try { RTC_Core.StopSound(); Stockpile.RestoreBizhawkConfig(); } finally { RTC_Core.StartSound(); } })).Enabled = (File.Exists(RTC_Core.bizhawkDir + "\\backup_config.ini")); LoadMenuItems.Show(this, locate); }