Esempio n. 1
0
        internal WindowSource()
        {
            _dispatcher = Dispatcher.CurrentDispatcher;

            _floatingStatusWindow = new FloatingStatusWindow(this);
            _floatingStatusWindow.SetText(Resources.Loading);

            Task.Factory.StartNew(Initialize);
        }
Esempio n. 2
0
        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));
        }