Пример #1
0
        public static void SetKeyStatic(string key, string value)
        {
            Database d = new Database();
            d.Open();

            d.SetKey(key, value);
        }
Пример #2
0
        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());
        }
Пример #3
0
        public static void SetKeyStatic(string key, string value)
        {
            Database d = new Database();

            d.Open();

            d.SetKey(key, value);
        }
Пример #4
0
        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;
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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;
            }
        }
Пример #7
0
        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());
        }
Пример #8
0
	    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);
			}
	    }