From aefa631ff3f648060f5c0fe5d51aee89e3898a85 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 9 Feb 2021 22:55:40 -0500 Subject: Discord RPC; About window --- Erable/ViewModels/MainWindowViewModel.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Erable/ViewModels/MainWindowViewModel.cs') diff --git a/Erable/ViewModels/MainWindowViewModel.cs b/Erable/ViewModels/MainWindowViewModel.cs index 899b49c..c99dfc2 100644 --- a/Erable/ViewModels/MainWindowViewModel.cs +++ b/Erable/ViewModels/MainWindowViewModel.cs @@ -11,8 +11,15 @@ namespace Erable.ViewModels public void PlayFunction() { - Thread t = new (Playback.PlayAudio); - t.Start(); + try + { + Thread t = new(Playback.PlayAudio); + t.Start(); + } + catch(Exception ex) + { + MessageBox.Show(new MainWindow(), ex.ToString(), "Error", MessageBox.MessageBoxButtons.Ok); + } } public void StopFunction() @@ -48,10 +55,9 @@ namespace Erable.ViewModels MessageBox.Show(new MainWindow(), "Hello world", "Test Title", MessageBox.MessageBoxButtons.Ok); } - public void Quit() + public void ExceptionButton() { - Environment.Exit(0); + throw new Exception(); } - } } -- cgit v1.2.3