mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Improved exceptions display.
This commit is contained in:
parent
3b0558b4ff
commit
0584b8a943
@ -17,7 +17,7 @@
|
||||
<!-- Accent and AppTheme setting -->
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Teal.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
|
||||
<ResourceDictionary Source="/Resources/Icons.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
@ -30,8 +29,12 @@ namespace Artemis.Managers
|
||||
_fps = 25;
|
||||
UpdateWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
||||
_processWorker = new BackgroundWorker();
|
||||
|
||||
UpdateWorker.DoWork += UpdateWorker_DoWork;
|
||||
UpdateWorker.RunWorkerCompleted += BackgroundWorkerExceptionCatcher;
|
||||
|
||||
_processWorker.DoWork += ProcessWorker_DoWork;
|
||||
_processWorker.RunWorkerCompleted += BackgroundWorkerExceptionCatcher;
|
||||
|
||||
// Process worker will always run (and just do nothing when ProgramEnabled is false)
|
||||
_processWorker.RunWorkerAsync();
|
||||
@ -210,6 +213,12 @@ namespace Artemis.Managers
|
||||
}
|
||||
}
|
||||
|
||||
private void BackgroundWorkerExceptionCatcher(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
if (e.Error != null)
|
||||
throw e.Error;
|
||||
}
|
||||
|
||||
private void ProcessWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
while (true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user