From d0eb0e9e2aa03a06a053c2a05785c3849661912e Mon Sep 17 00:00:00 2001 From: Gian Luca Da Silva Figueiredo Date: Tue, 15 Oct 2024 13:29:59 -0300 Subject: [PATCH] [GMH] Corrigir nome da interface --- .../Interfaces/{ICloudOperations.cs => IOperations.cs} | 8 ++++---- iso.gmh.desktop/ViewModel/GamesListViewModel.cs | 6 +++--- iso.gmh.desktop/ViewModel/GamesViewModel.cs | 6 +++--- iso.gmh.dropbox/DropboxOperations.cs | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) rename iso.gmh.core/Interfaces/{ICloudOperations.cs => IOperations.cs} (94%) diff --git a/iso.gmh.core/Interfaces/ICloudOperations.cs b/iso.gmh.core/Interfaces/IOperations.cs similarity index 94% rename from iso.gmh.core/Interfaces/ICloudOperations.cs rename to iso.gmh.core/Interfaces/IOperations.cs index 40cb63f..13286c8 100644 --- a/iso.gmh.core/Interfaces/ICloudOperations.cs +++ b/iso.gmh.core/Interfaces/IOperations.cs @@ -5,7 +5,7 @@ using iso.gmh.Core.Models; -public interface ICloudOperations +public interface IOperations { /// /// Apaga arquivo do serviço de armazenamento na nuvem. @@ -16,7 +16,7 @@ public interface ICloudOperations /// /// True caso tenha apagado e Falso caso não tenha sido apagado. /// - Task DeleteSave( + Task Delete( string path ); @@ -53,7 +53,7 @@ string folderName /// /// True se o save pode ser recuperado e Falso caso não tenha sido recuperado. /// - Task DownloadSaveData( + Task Download( Game game ); @@ -69,7 +69,7 @@ Game game /// /// True caso tenha sido salvo e Falso caso não tenha sido salvo. /// - Task UploadSaveData( + Task Upload( Game game, bool overwrite = false ); diff --git a/iso.gmh.desktop/ViewModel/GamesListViewModel.cs b/iso.gmh.desktop/ViewModel/GamesListViewModel.cs index dab1dc2..e8568e0 100644 --- a/iso.gmh.desktop/ViewModel/GamesListViewModel.cs +++ b/iso.gmh.desktop/ViewModel/GamesListViewModel.cs @@ -41,7 +41,7 @@ public GamesListEntry SelectedSave } } - private readonly ICloudOperations Operations; + private readonly IOperations Operations; private RelayCommand deleteSaveCommand; @@ -68,7 +68,7 @@ public GamesListViewModel() : this(null, null, false) { } - public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList, ICloudOperations operations, bool visible) + public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList, IOperations operations, bool visible) { SavesList = Converter(saveList); ShowList = visible @@ -80,7 +80,7 @@ public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList, private async Task DeleteSave(GamesListEntry gameEntry) { - if (await Operations.DeleteSave(gameEntry.PathToFile)) + if (await Operations.Delete(gameEntry.PathToFile)) _ = SavesList.Remove(gameEntry); } diff --git a/iso.gmh.desktop/ViewModel/GamesViewModel.cs b/iso.gmh.desktop/ViewModel/GamesViewModel.cs index 4311a60..2d99eae 100644 --- a/iso.gmh.desktop/ViewModel/GamesViewModel.cs +++ b/iso.gmh.desktop/ViewModel/GamesViewModel.cs @@ -26,7 +26,7 @@ IFactory BackupStrategy ) : BaseViewModel { private IBackupStrategy BackupStrategy; - private ICloudOperations CloudOperations => GetClientOperations(); + private IOperations CloudOperations => GetClientOperations(); private RelayCommand _UploadCommand; private RelayCommand _DownloadCommand; @@ -187,7 +187,7 @@ private async Task UploadSave(MessageBoxResult messageBoxResult) if (!exists) _ = await CloudOperations.CreateFolder(GameInformation.OnlineSaveFolder); - return await CloudOperations.UploadSaveData(GameInformation, messageBoxResult == MessageBoxResult.Yes); + return await CloudOperations.Upload(GameInformation, messageBoxResult == MessageBoxResult.Yes); } private async Task DownloadSave() @@ -200,6 +200,6 @@ private async Task DownloadSave() GameInformation.SetSaveBackupExtension(BackupStrategy.GetFileExtension()); - return await CloudOperations.DownloadSaveData(GameInformation); + return await CloudOperations.Download(GameInformation); } } \ No newline at end of file diff --git a/iso.gmh.dropbox/DropboxOperations.cs b/iso.gmh.dropbox/DropboxOperations.cs index d781547..501b45b 100644 --- a/iso.gmh.dropbox/DropboxOperations.cs +++ b/iso.gmh.dropbox/DropboxOperations.cs @@ -19,7 +19,7 @@ public class DropboxOperations( DropboxClient client, IBackupStrategy backupStrategy - ) : ICloudOperations + ) : IOperations { private readonly DropboxClient Client = client; private readonly IBackupStrategy BackupStrategy = backupStrategy; @@ -61,7 +61,7 @@ private static bool CheckIfFolderExistsInList(string folderName, ListFolderResul return listaSaves; } - public async Task DownloadSaveData(Game gameInformation) + public async Task Download(Game gameInformation) { if (gameInformation == null || !await CheckFolderExistence(gameInformation.OnlineSaveFolder)) @@ -88,7 +88,7 @@ public async Task DownloadSaveData(Game gameInformation) return true; } - public async Task UploadSaveData(Game gameInformation, bool overwriteSave) + public async Task Upload(Game gameInformation, bool overwriteSave) { if (gameInformation == null) return false; @@ -142,7 +142,7 @@ public async Task CreateFolder(string path) return string.IsNullOrEmpty(result.Metadata.Id); } - public async Task DeleteSave(string path) + public async Task Delete(string path) { if (string.IsNullOrWhiteSpace(path)) return false;