From 52cd8a8c3381e20d5997887b5cf5f605536f29b5 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 3 Oct 2022 15:06:44 +0900 Subject: [PATCH] Adjust Clock Code --- Flow.Launcher/MainWindow.xaml.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index bc18d8dbc..4eac8f9b5 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -22,6 +22,7 @@ using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin.SharedCommands; using System.Windows.Threading; using System.Globalization; +using System.Reflection.Emit; namespace Flow.Launcher { @@ -47,11 +48,15 @@ namespace Flow.Launcher _settings = settings; - DispatcherTimer timer = new DispatcherTimer(); - timer.Interval = new TimeSpan(0, 0, 1); - timer.Tick += Timer_Tick; + var timer = new Timer + { + Interval = 1000, + }; + timer.Tick += (s, evt) => + { + ClockDisplay(); + }; timer.Start(); - InitializeComponent(); InitializePosition(); animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); @@ -61,10 +66,6 @@ namespace Flow.Launcher { InitializeComponent(); } - private void Timer_Tick(object sender, EventArgs e) - { - ClockDisplay(); - } public void ClockDisplay() {