public static void SetKeyStatic(string key, string value) { Database d = new Database(); d.Open(); d.SetKey(key, value); }
void AdditionalTimingClick(object sender, EventArgs e) { // Get the current value from the database Classes.Database d = new SuperPutty.Classes.Database(); d.Open(); string key = "additional_timing"; bool val = false; val = d.GetKey(key) == "" ? false : bool.Parse(d.GetKey(key)); // If the value is true, then set it to false and uncheck menu item, // else, set it to true. if (val) { val = false; } else { val = true; } // Set the menu item check state. this.additionalTiming.Checked = val; // Update the database d.SetKey(key, val.ToString()); }
private void quickConnectToolStripMenuItem_Click(object sender, EventArgs e) { Classes.Database d = new SuperPutty.Classes.Database(); d.Open(); if (this.ConnectToolStrip.Visible) { this.ConnectToolStrip.Hide(); d.SetKey("ShowQuickConnectBar", "false"); this.quickConnectToolStripMenuItem.Checked = false; } else { this.ConnectToolStrip.Show(); d.SetKey("ShowQuickConnectBar", "true"); this.quickConnectToolStripMenuItem.Checked = true; } }
private void firstTimeAutomaticUpdateCheck() { // Get the current value from the database Classes.Database d = new SuperPutty.Classes.Database(); d.Open(); string key = "automatic_update_check"; string val = d.GetKey(key); // If the value hasnt been set, then the user has not chosen. if (val == "") { bool enabled = false; if (MessageBox.Show("Do you wish to enable automatic update checks?", "SuperPutty", MessageBoxButtons.YesNo) == DialogResult.Yes) { enabled = true; } // Store the users decision d.SetKey(key, enabled.ToString()); MessageBox.Show("You may enable/disable automatic update checks by navigating to the File->Settings menu.", "SuperPutty", MessageBoxButtons.OK); } }