private void MainForm_Load(object sender, EventArgs e) { RefreshUserStore(); RefreshSettings(); RefreshSelectedKeyInfo(); RefreshInsertedKey(); _hsmUpdateTimer.Interval = 1000; _hsmUpdateTimer.Tick += HsmUpdateTimerOnTick; _hsmUpdateTimer.Start(); lblStatusStripVersion.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version; // Start worker that checks for inserted yubikeys YubikeyDetector.Instance.StateChanged += YubikeyStateChange; YubikeyDetector.Instance.Start(); // Determine if we need to get the settings set if (!File.Exists(FileSettings) || _settings.DefaultAlgorithm == 0) { DlgSettings dialog = new DlgSettings(_settings); DialogResult res = dialog.ShowDialog(); if (res != DialogResult.OK) { MetroMessageBox.Show(this, "You have to set the settings. Restart the application to set the settings.", "Settings not set", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } } RefreshHsm(); }
private void tsbSettings_Click(object sender, EventArgs e) { DlgSettings dialog = new DlgSettings(_settings); dialog.ShowDialog(); }