Ver Fonte

Refactor and rename

Ruben há 1 ano atrás
pai
commit
23ae72b117

+ 1 - 1
src/PicView.Avalonia.MacOS/App.axaml.cs

@@ -78,7 +78,7 @@ public class App : Application, IPlatformSpecificService
     public List<string> GetFiles(FileInfo fileInfo)
     {
         var files = FileListHelper.RetrieveFiles(fileInfo);
-        return SortingHelper.SortIEnumerable(files, this);
+        return FileListManager.SortIEnumerable(files, this);
     }
 
     public int CompareStrings(string str1, string str2)

+ 1 - 1
src/PicView.Avalonia.Win32/App.axaml.cs

@@ -113,7 +113,7 @@ public class App : Application, IPlatformSpecificService
     public List<string> GetFiles(FileInfo fileInfo)
     {
         var files = FileListHelper.RetrieveFiles(fileInfo);
-        return SortingHelper.SortIEnumerable(files, this);
+        return FileListManager.SortIEnumerable(files, this);
     }
 
     public int CompareStrings(string str1, string str2)

+ 4 - 0
src/PicView.Avalonia/Navigation/FileHistoryNavigation.cs

@@ -4,6 +4,10 @@ using PicView.Core.Navigation;
 
 namespace PicView.Avalonia.Navigation;
 
+
+// TODO: This file needs to me removed and the FileHistory class needs to use interfaces instead.
+
+
 public static class FileHistoryNavigation
 {
     private static FileHistory? _fileHistory;

+ 1 - 1
src/PicView.Avalonia/Navigation/SortingHelper.cs → src/PicView.Avalonia/Navigation/FileListManager.cs

@@ -7,7 +7,7 @@ using PicView.Core.FileHandling;
 
 namespace PicView.Avalonia.Navigation;
 
-public static class SortingHelper
+public static class FileListManager
 {
     public static List<string> SortIEnumerable(IEnumerable<string> files, IPlatformSpecificService? platformService)
     {

+ 1 - 1
src/PicView.Avalonia/UI/ThemeManager.cs → src/PicView.Avalonia/PicViewTheme/ThemeManager.cs

@@ -2,7 +2,7 @@
 using Avalonia.Styling;
 using PicView.Core.Config;
 
-namespace PicView.Avalonia.UI;
+namespace PicView.Avalonia.PicViewTheme;
 public static class ThemeManager
 {
     // TODO: Implement changing Dark/Light theme

+ 9 - 9
src/PicView.Avalonia/UI/FunctionsHelper.cs

@@ -777,7 +777,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm.PlatformService, Vm, FileListHelper.SortFilesBy.Name);
+        await FileListManager.UpdateFileList(Vm.PlatformService, Vm, FileListHelper.SortFilesBy.Name);
     }
 
     public static async Task SortFilesByCreationTime()
@@ -786,7 +786,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.CreationTime);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.CreationTime);
     }
 
     public static async Task SortFilesByLastAccessTime()
@@ -795,7 +795,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.LastAccessTime);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.LastAccessTime);
     }
 
     public static async Task SortFilesByLastWriteTime()
@@ -804,7 +804,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.LastWriteTime);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.LastWriteTime);
     }
 
     public static async Task SortFilesBySize()
@@ -813,7 +813,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.FileSize);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.FileSize);
     }
 
     public static async Task SortFilesByExtension()
@@ -822,7 +822,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.Extension);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.Extension);
     }
 
     public static async Task SortFilesRandomly()
@@ -831,7 +831,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.Random);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, FileListHelper.SortFilesBy.Random);
     }
 
     public static async Task SortFilesAscending()
@@ -840,7 +840,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, ascending: true);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, ascending: true);
     }
 
     public static async Task SortFilesDescending()
@@ -849,7 +849,7 @@ public static class FunctionsHelper
         {
             return;
         }
-        await SortingHelper.UpdateFileList(Vm?.PlatformService, Vm, ascending: false);
+        await FileListManager.UpdateFileList(Vm?.PlatformService, Vm, ascending: false);
     }
 
     #endregion Sorting