Skip to content

Commit

Permalink
turn off timer when not in use
Browse files Browse the repository at this point in the history
  • Loading branch information
schulz89 committed Jun 21, 2024
1 parent a9eb0f7 commit f309cd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion KyuTerm/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ private void SetupClipboardMonitor()
clipboardTimer = new DispatcherTimer();
clipboardTimer.Interval = TimeSpan.FromSeconds(1); // Check every second
clipboardTimer.Tick += ClipboardTimer_Tick;
clipboardTimer.Start();
}

private void ClipboardTimer_Tick(object sender, EventArgs e)
Expand Down Expand Up @@ -296,11 +295,13 @@ private void PortComboBox_DropDownOpened(object sender, EventArgs e)
private void CheckBoxAutoInsert_Checked(object sender, RoutedEventArgs e)
{
autoInsert = true;
clipboardTimer.Start();
}

private void CheckBoxAutoInsert_Unchecked(object sender, RoutedEventArgs e)
{
autoInsert = false;
clipboardTimer.Stop();
}
}
}

0 comments on commit f309cd8

Please sign in to comment.