示例#1
0
 public static void loadConfig()
 {
     registerHotKey();
     if (OtpTime.getTimeType() == OtpTimeType.CustomNtpServer)
     {
         OtpTime.pollCustomNtpServer();
     }
 }
示例#2
0
文件: Settings.cs 项目: tiuub/KeeOtp2
        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();
        }
示例#3
0
文件: Settings.cs 项目: tiuub/KeeOtp2
 private void buttonCustomNTPServerOK_Click(object sender, EventArgs e)
 {
     textBoxCustomNTPServerAddress.Enabled = false;
     OtpTime.pollCustomNtpServer(textBoxCustomNTPServerAddress.Text);
     textBoxCustomNTPServerAddress.Enabled = true;
 }