private static void OnTick_Open(object sender, EventArgs e) { if (UserInputInfo.GetLastInputTime() < _settings.IdleTimerLength) { Timer.Tick -= OnTick_Open; Timer.Tick += OnTick; _mainForm.Close(); } }
private static void OnTick(object sender, EventArgs e) { if (UserInputInfo.GetLastInputTime() >= _settings.IdleTimerLength) { Timer.Tick -= OnTick; Timer.Tick += OnTick_Open; _mainForm = new MainForm(_settings.LogoffCountdownLength, _settings.DebugMode); _mainForm.Show(); } }