public static void loadConfig() { registerHotKey(); if (OtpTime.getTimeType() == OtpTimeType.CustomNtpServer) { OtpTime.pollCustomNtpServer(); } }
private void loadConfig() { textBoxHotKeySequence.Text = KeeOtp2Config.HotKeySequence; Keys hotKey = KeeOtp2Config.HotKeyKeys; hotKeyControlExGlobalHotkey.HotKey = hotKey; if (KeeOtp2Config.UseHotKey && hotKey != Keys.None) { checkBoxUseHotkey.Checked = true; textBoxHotKeySequence.Enabled = true; hotKeyControlExGlobalHotkey.Enabled = true; } else { checkBoxUseHotkey.Checked = false; textBoxHotKeySequence.Enabled = false; hotKeyControlExGlobalHotkey.Enabled = false; } radioButtonSystemTime.Checked = radioButtonFixedTimeOffset.Checked = numericUpDownFixedTimeOffset.Enabled = radioButtonCustomNtpServer.Checked = textBoxCustomNTPServerAddress.Enabled = false; switch (OtpTime.getTimeType()) { case OtpTimeType.SystemTime: radioButtonSystemTime.Checked = true; break; case OtpTimeType.FixedOffset: radioButtonFixedTimeOffset.Checked = true; numericUpDownFixedTimeOffset.Enabled = true; break; case OtpTimeType.CustomNtpServer: radioButtonCustomNtpServer.Checked = true; textBoxCustomNTPServerAddress.Enabled = true; OtpTime.pollCustomNtpServer(); break; default: radioButtonSystemTime.Checked = true; break; } numericUpDownFixedTimeOffset.Value = OtpTime.getFixedTimeOffset(); textBoxCustomNTPServerAddress.Text = OtpTime.getCustomNtpServer(); checkBoxOverrideBuiltInTime.Checked = OtpTime.getOverrideBuiltInTime(); }
private void buttonCustomNTPServerOK_Click(object sender, EventArgs e) { textBoxCustomNTPServerAddress.Enabled = false; OtpTime.pollCustomNtpServer(textBoxCustomNTPServerAddress.Text); textBoxCustomNTPServerAddress.Enabled = true; }