From a0cd57480cd5374d1f42750c0dafc34669dd540f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:02:40 +0000 Subject: [PATCH] Automated JetBrains cleanup Co-authored-by: <+@users.noreply.github.com> --- .../Controls/FileOpenPicker.axaml.cs | 6 +++--- .../Controls/FileSavePicker.axaml.cs | 14 +++++++------- .../Infrastructure/ConsoloniaStorageProvider.cs | 3 ++- src/Tests/Consolonia.Core.Tests/StorageTests.cs | 3 ++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Consolonia.Core/Controls/FileOpenPicker.axaml.cs b/src/Consolonia.Core/Controls/FileOpenPicker.axaml.cs index 3e575fb..98977bc 100644 --- a/src/Consolonia.Core/Controls/FileOpenPicker.axaml.cs +++ b/src/Consolonia.Core/Controls/FileOpenPicker.axaml.cs @@ -19,11 +19,11 @@ public FileOpenPicker(FilePickerOpenOptions options) } /// - /// Gets the view model associated with this picker. + /// Gets the view model associated with this picker. /// /// Thrown when the DataContext is null or not of type FileOpenPickerViewModel. - public FileOpenPickerViewModel ViewModel => - DataContext as FileOpenPickerViewModel + public FileOpenPickerViewModel ViewModel => + DataContext as FileOpenPickerViewModel ?? throw new InvalidOperationException("DataContext is not properly initialized."); private void InitializeComponent() diff --git a/src/Consolonia.Core/Controls/FileSavePicker.axaml.cs b/src/Consolonia.Core/Controls/FileSavePicker.axaml.cs index 25ab406..3c897da 100644 --- a/src/Consolonia.Core/Controls/FileSavePicker.axaml.cs +++ b/src/Consolonia.Core/Controls/FileSavePicker.axaml.cs @@ -19,20 +19,20 @@ public FileSavePicker(FilePickerSaveOptions options) } /// - /// Gets the file picker save options associated with this dialog. + /// Gets the file picker save options associated with this dialog. /// /// Thrown when DataContext is null or of incorrect type. public FilePickerSaveOptions Options => - (DataContext as FileSavePickerViewModel)?.Options - ?? throw new InvalidOperationException($"Invalid DataContext. Expected {nameof(FileSavePickerViewModel)}"); + (DataContext as FileSavePickerViewModel)?.Options + ?? throw new InvalidOperationException($"Invalid DataContext. Expected {nameof(FileSavePickerViewModel)}"); /// - /// Gets the view model associated with this dialog. + /// Gets the view model associated with this dialog. /// /// Thrown when DataContext is null or of incorrect type. - public FileSavePickerViewModel ViewModel => - DataContext as FileSavePickerViewModel - ?? throw new InvalidOperationException($"Invalid DataContext. Expected {nameof(FileSavePickerViewModel)}"); + public FileSavePickerViewModel ViewModel => + DataContext as FileSavePickerViewModel + ?? throw new InvalidOperationException($"Invalid DataContext. Expected {nameof(FileSavePickerViewModel)}"); private void InitializeComponent() { diff --git a/src/Consolonia.Core/Infrastructure/ConsoloniaStorageProvider.cs b/src/Consolonia.Core/Infrastructure/ConsoloniaStorageProvider.cs index c0c1b08..49d54b7 100644 --- a/src/Consolonia.Core/Infrastructure/ConsoloniaStorageProvider.cs +++ b/src/Consolonia.Core/Infrastructure/ConsoloniaStorageProvider.cs @@ -82,7 +82,8 @@ public Task TryGetWellKnownFolderAsync(WellKnownFolder wellKnown { WellKnownFolder.Desktop => Environment.GetFolderPath(Environment.SpecialFolder.Desktop), WellKnownFolder.Documents => Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), - WellKnownFolder.Downloads => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"), + WellKnownFolder.Downloads => Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"), WellKnownFolder.Pictures => Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), WellKnownFolder.Music => Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), WellKnownFolder.Videos => Environment.GetFolderPath(Environment.SpecialFolder.MyVideos), diff --git a/src/Tests/Consolonia.Core.Tests/StorageTests.cs b/src/Tests/Consolonia.Core.Tests/StorageTests.cs index 29bdfaf..c218049 100644 --- a/src/Tests/Consolonia.Core.Tests/StorageTests.cs +++ b/src/Tests/Consolonia.Core.Tests/StorageTests.cs @@ -112,7 +112,8 @@ public async Task TestWellKnownFolder() folder = await storageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Downloads); if (folder != null) - Assert.AreEqual(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"), + Assert.AreEqual( + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"), folder.Path.LocalPath); folder = await storageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Desktop);