private void HandleUpdateStatus(UpdateCheck.UpdateStatus status, string message) { if (status == UpdateCheck.UpdateStatus.None) { message = Resources.Loading; } _dispatcher.Invoke(() => _floatingStatusWindow.SetText(message)); }
internal WindowSource() { _dispatcher = Dispatcher.CurrentDispatcher; _floatingStatusWindow = new FloatingStatusWindow(this); _floatingStatusWindow.SetText(Resources.Loading); Task.Factory.StartNew(Initialize); }
internal WindowSource() { _dispatcher = Dispatcher.CurrentDispatcher; try { using (var taskService = new TaskService()) { var existingTask = taskService.FindTask(ScheduledTaskName); if (existingTask == null) { var assembly = Assembly.GetExecutingAssembly(); var path = Path.GetDirectoryName(assembly.Location); if (path != null) { var fileName = Path.Combine(path, "Service", "SystemTemperatureService.exe"); Process.Start(fileName, "-install"); } } } } catch (Exception) { // Ignored } _floatingStatusWindow = new FloatingStatusWindow(this); _floatingStatusWindow.SetText(Resources.Loading); _refreshTimer = new Timer(Settings.Default.UpdateInterval) { AutoReset = false }; _refreshTimer.Elapsed += HandleTimerElapsed; System.Threading.Tasks.Task.Factory.StartNew(UpdateApp).ContinueWith(task => StartUpdate(task.Result.Result)); }