diff options
author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2023-09-25 18:04:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-26 00:04:58 +0200 |
commit | d6d3cdd5739e6b8f8df36bf393e440f4857fb2b7 (patch) | |
tree | e483c2c0352c5fbba137596cc9603773a571e6b7 /src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs | |
parent | 53bd4c9f603c95929ad17fffcce2fe1de04e3ae1 (diff) |
Ava UI: Refactor `async` usage (#5516)1.1.1027
* Remove `async void`
* Async LoadApplications
* Formatting and such
* Remove async from InstallUpdate
* Update src/Ryujinx.Ava/UI/Controls/ApplicationContextMenu.axaml.cs
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
* Cleanup LoadApplications()
* Cleanup
* Formatting
* Revert some stuff
* Cleanup
* Update src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Ack suggestions
* Whitespace
* Fix Peri suggestion
* Add missing trailing commas
* Remove redundant method override
* Remove Dispatcher.UIThread.InvokeAsync/Post where possible
---------
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs')
-rw-r--r-- | src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs index af8c4dab..4f2d262d 100644 --- a/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs @@ -17,7 +17,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Views.Main { @@ -107,20 +106,14 @@ namespace Ryujinx.Ava.UI.Views.Main await Window.ViewModel.AppHost?.ShowExitPrompt(); } - private async void PauseEmulation_Click(object sender, RoutedEventArgs e) + private void PauseEmulation_Click(object sender, RoutedEventArgs e) { - await Task.Run(() => - { - Window.ViewModel.AppHost?.Pause(); - }); + Window.ViewModel.AppHost?.Pause(); } - private async void ResumeEmulation_Click(object sender, RoutedEventArgs e) + private void ResumeEmulation_Click(object sender, RoutedEventArgs e) { - await Task.Run(() => - { - Window.ViewModel.AppHost?.Resume(); - }); + Window.ViewModel.AppHost?.Resume(); } public async void OpenSettings(object sender, RoutedEventArgs e) @@ -132,13 +125,13 @@ namespace Ryujinx.Ava.UI.Views.Main ViewModel.LoadConfigurableHotKeys(); } - public void OpenMiiApplet(object sender, RoutedEventArgs e) + public async void OpenMiiApplet(object sender, RoutedEventArgs e) { string contentPath = ViewModel.ContentManager.GetInstalledContentPath(0x0100000000001009, StorageId.BuiltInSystem, NcaContentType.Program); if (!string.IsNullOrEmpty(contentPath)) { - ViewModel.LoadApplication(contentPath, false, "Mii Applet"); + await ViewModel.LoadApplication(contentPath, false, "Mii Applet"); } } @@ -196,8 +189,7 @@ namespace Ryujinx.Ava.UI.Views.Main { if (FileAssociationHelper.Install()) { - await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesSuccessMessage], - string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty); + await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty); } else { @@ -209,8 +201,7 @@ namespace Ryujinx.Ava.UI.Views.Main { if (FileAssociationHelper.Uninstall()) { - await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesSuccessMessage], - string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty); + await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty); } else { |