From 85e375123e7a24e0e2fdec65e273752e604ecee2 Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 6 Jul 2023 22:10:17 -0400 Subject: [PATCH] Move common classes to Core assembly --- .../Json/DefaultUnknownEnumConverter.cs | 7 +++-- .../Json/LaunchOptionValueJsonConverter.cs | 5 ++-- .../Extensions/EnumAttributes.cs | 4 +-- .../Extensions/EnumConversion.cs | 4 +-- .../Extensions/EnumerableExtensions.cs | 5 +--- .../Extensions/LiteDBExtensions.cs | 7 ++--- .../Helper/Cache/GithubApiCache.cs | 8 ++---- .../Helper/Cache/IGithubApiCache.cs | 7 ++--- .../Helper/Cache/LRUCache.cs | 5 ++-- .../Helper/Expressions.cs | 5 ++-- .../StabilityMatrix.Core}/Helper/FileHash.cs | 7 ++--- .../Helper/FileTransfers.cs | 9 ++----- .../Helper/HardwareHelper.cs | 27 ++----------------- .../Helper/MinimumDelay.cs | 6 ++--- .../Helper/ObjectHash.cs | 5 ++-- .../Helper/ProcessRunner.cs | 9 ++----- .../Helper/ProcessTracker.cs | 7 ++--- .../StabilityMatrix.Core/Helper/Size.cs | 22 +++++++++++++++ .../Helper/SystemInfo.cs | 4 +-- .../StabilityMatrix.Core}/Helper/Utilities.cs | 6 ++--- .../Models/Configs/DebugOptions.cs | 2 +- .../Models/FileInterfaces/DirectoryPath.cs | 6 +---- .../Models/FileInterfaces/FilePath.cs | 5 +--- .../Models/FileInterfaces/FileSystemPath.cs | 5 +--- .../Models/FileInterfaces/IPathObject.cs | 4 +-- .../Models/FileSizeType.cs | 2 +- .../Models/GlobalConfig.cs | 5 ++-- .../Models/InstalledPackage.cs | 10 +++---- .../Models/LaunchOption.cs | 9 +++---- .../Models/LaunchOptionCard.cs | 2 +- .../Models/LaunchOptionDefinition.cs | 5 ++-- .../Models/LaunchOptionType.cs | 2 +- .../Models/LicenseInfo.cs | 4 +-- .../StabilityMatrix.Core}/Models/LoadState.cs | 2 +- .../Models/PackageVersion.cs | 2 +- .../Models/SharedFolderType.cs | 5 ++-- .../Models/TaskResult.cs | 5 ++-- .../StabilityMatrix.Core}/Python/ArgParser.cs | 9 +++---- .../StabilityMatrix.Core}/Python/IPyRunner.cs | 7 +---- .../Python/Interop/PyIOStream.cs | 7 ++--- .../StabilityMatrix.Core}/Python/PyRunner.cs | 12 +++------ .../Python/PyVenvRunner.cs | 13 +++------ .../ReparsePoints/DeviceIoControlCode.cs | 2 +- .../ReparsePoints/Junction.cs | 6 ++--- .../ReparsePoints/ReparseDataBuffer.cs | 2 +- .../ReparsePoints/Win32CreationDisposition.cs | 2 +- .../ReparsePoints/Win32ErrorCode.cs | 14 +++++----- .../ReparsePoints/Win32FileAccess.cs | 4 +-- .../ReparsePoints/Win32FileAttribute.cs | 5 ++-- .../ReparsePoints/Win32FileShare.cs | 4 +-- .../StabilityMatrix.Core.csproj | 22 +++++++++++++++ .../Models/InstalledPackageTests.cs | 3 ++- .../Models/SharedFoldersTests.cs | 3 ++- StabilityMatrix.Tests/Python/PyRunnerTests.cs | 2 +- .../ReparsePoints/JunctionTests.cs | 2 +- StabilityMatrix/App.xaml.cs | 6 ++--- StabilityMatrix/Database/LiteDbContext.cs | 4 +-- StabilityMatrix/Helper/ArchiveHelper.cs | 1 + StabilityMatrix/Helper/DialogFactory.cs | 1 + StabilityMatrix/Helper/IDialogFactory.cs | 1 + StabilityMatrix/Helper/ISettingsManager.cs | 1 + StabilityMatrix/Helper/ISnackbarService.cs | 1 + StabilityMatrix/Helper/PrerequisiteHelper.cs | 3 ++- StabilityMatrix/Helper/SettingsManager.cs | 4 ++- StabilityMatrix/Helper/SnackbarService.cs | 1 + StabilityMatrix/InstallerWindow.xaml | 4 +-- StabilityMatrix/LaunchOptionsDialog.xaml | 2 +- StabilityMatrix/LaunchOptionsDialog.xaml.cs | 1 + StabilityMatrix/LaunchPage.xaml | 6 ++--- StabilityMatrix/Models/Api/CivitModel.cs | 1 + StabilityMatrix/Models/Api/CivitModelType.cs | 5 ++-- StabilityMatrix/Models/CheckpointFile.cs | 3 ++- StabilityMatrix/Models/CheckpointFolder.cs | 6 +++-- StabilityMatrix/Models/GlobalUserSecrets.cs | 3 ++- StabilityMatrix/Models/ISharedFolders.cs | 2 +- StabilityMatrix/Models/Packages/A3WebUI.cs | 4 ++- .../Models/Packages/BaseGitPackage.cs | 5 ++-- .../Models/Packages/BasePackage.cs | 2 ++ StabilityMatrix/Models/Packages/ComfyUI.cs | 4 ++- .../Models/Packages/DankDiffusion.cs | 3 ++- .../Models/Packages/VladAutomatic.cs | 6 +++-- StabilityMatrix/Models/Settings/Settings.cs | 1 + StabilityMatrix/Models/SharedFolders.cs | 7 ++--- StabilityMatrix/PackageManagerPage.xaml | 2 +- StabilityMatrix/Updater/UpdateChannel.cs | 2 +- StabilityMatrix/Updater/UpdateHelper.cs | 4 +-- .../CheckpointBrowserCardViewModel.cs | 6 +++-- .../ViewModels/CheckpointBrowserViewModel.cs | 4 ++- .../DataDirectoryMigrationViewModel.cs | 5 ++-- .../ViewModels/FirstLaunchSetupViewModel.cs | 1 + .../ViewModels/InstallerViewModel.cs | 5 ++-- .../LaunchOptionsDialogViewModel.cs | 3 ++- StabilityMatrix/ViewModels/LaunchViewModel.cs | 4 ++- .../ViewModels/MainWindowViewModel.cs | 3 ++- .../ViewModels/OneClickInstallViewModel.cs | 3 ++- .../ViewModels/PackageManagerViewModel.cs | 1 + .../SelectInstallLocationsViewModel.cs | 1 + .../ViewModels/SettingsViewModel.cs | 4 ++- .../ViewModels/TextToImageViewModel.cs | 3 ++- .../ViewModels/UpdateWindowViewModel.cs | 1 + 100 files changed, 236 insertions(+), 257 deletions(-) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Converters/Json/DefaultUnknownEnumConverter.cs (89%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Converters/Json/LaunchOptionValueJsonConverter.cs (94%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Extensions/EnumAttributes.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Extensions/EnumConversion.cs (92%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Extensions/EnumerableExtensions.cs (80%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Extensions/LiteDBExtensions.cs (94%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/Cache/GithubApiCache.cs (92%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/Cache/IGithubApiCache.cs (76%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/Cache/LRUCache.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/Expressions.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/FileHash.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/FileTransfers.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/HardwareHelper.cs (80%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/MinimumDelay.cs (90%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/ObjectHash.cs (87%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/ProcessRunner.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/ProcessTracker.cs (97%) create mode 100644 StabilityMatrix.Core/StabilityMatrix.Core/Helper/Size.cs rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/SystemInfo.cs (71%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Helper/Utilities.cs (94%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/Configs/DebugOptions.cs (91%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/FileInterfaces/DirectoryPath.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/FileInterfaces/FilePath.cs (95%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/FileInterfaces/FileSystemPath.cs (92%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/FileInterfaces/IPathObject.cs (90%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/FileSizeType.cs (95%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/GlobalConfig.cs (91%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/InstalledPackage.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LaunchOption.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LaunchOptionCard.cs (95%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LaunchOptionDefinition.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LaunchOptionType.cs (60%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LicenseInfo.cs (84%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/LoadState.cs (61%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/PackageVersion.cs (75%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/SharedFolderType.cs (87%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Models/TaskResult.cs (88%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Python/ArgParser.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Python/IPyRunner.cs (94%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Python/Interop/PyIOStream.cs (89%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Python/PyRunner.cs (97%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/Python/PyVenvRunner.cs (96%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/DeviceIoControlCode.cs (93%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Junction.cs (99%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/ReparseDataBuffer.cs (97%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Win32CreationDisposition.cs (75%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Win32ErrorCode.cs (70%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Win32FileAccess.cs (74%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Win32FileAttribute.cs (95%) rename {StabilityMatrix => StabilityMatrix.Core/StabilityMatrix.Core}/ReparsePoints/Win32FileShare.cs (70%) diff --git a/StabilityMatrix/Converters/Json/DefaultUnknownEnumConverter.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/DefaultUnknownEnumConverter.cs similarity index 89% rename from StabilityMatrix/Converters/Json/DefaultUnknownEnumConverter.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/DefaultUnknownEnumConverter.cs index da44e3ab..d0c8a7bb 100644 --- a/StabilityMatrix/Converters/Json/DefaultUnknownEnumConverter.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/DefaultUnknownEnumConverter.cs @@ -1,9 +1,8 @@ -using System; -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Extensions; -namespace StabilityMatrix.Converters.Json; +namespace StabilityMatrix.Core.Converters.Json; public class DefaultUnknownEnumConverter : JsonConverter where T : Enum { diff --git a/StabilityMatrix/Converters/Json/LaunchOptionValueJsonConverter.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/LaunchOptionValueJsonConverter.cs similarity index 94% rename from StabilityMatrix/Converters/Json/LaunchOptionValueJsonConverter.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/LaunchOptionValueJsonConverter.cs index 32ae39a1..be3f1d6b 100644 --- a/StabilityMatrix/Converters/Json/LaunchOptionValueJsonConverter.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Converters/Json/LaunchOptionValueJsonConverter.cs @@ -1,8 +1,7 @@ -using System; -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; -namespace StabilityMatrix.Converters.Json; +namespace StabilityMatrix.Core.Converters.Json; public class LaunchOptionValueJsonConverter : JsonConverter { diff --git a/StabilityMatrix/Extensions/EnumAttributes.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumAttributes.cs similarity index 96% rename from StabilityMatrix/Extensions/EnumAttributes.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumAttributes.cs index 4f89ae60..cf8513cc 100644 --- a/StabilityMatrix/Extensions/EnumAttributes.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumAttributes.cs @@ -1,6 +1,4 @@ -using System; - -namespace StabilityMatrix.Extensions; +namespace StabilityMatrix.Core.Extensions; public static class EnumAttributeExtensions { diff --git a/StabilityMatrix/Extensions/EnumConversion.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumConversion.cs similarity index 92% rename from StabilityMatrix/Extensions/EnumConversion.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumConversion.cs index 10500508..e7fdf471 100644 --- a/StabilityMatrix/Extensions/EnumConversion.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumConversion.cs @@ -1,6 +1,4 @@ -using System; - -namespace StabilityMatrix.Extensions; +namespace StabilityMatrix.Core.Extensions; public static class EnumConversionExtensions { diff --git a/StabilityMatrix/Extensions/EnumerableExtensions.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumerableExtensions.cs similarity index 80% rename from StabilityMatrix/Extensions/EnumerableExtensions.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumerableExtensions.cs index e7477edb..6715e5f1 100644 --- a/StabilityMatrix/Extensions/EnumerableExtensions.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/EnumerableExtensions.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -namespace StabilityMatrix.Extensions; +namespace StabilityMatrix.Core.Extensions; public static class EnumerableExtensions { diff --git a/StabilityMatrix/Extensions/LiteDBExtensions.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/LiteDBExtensions.cs similarity index 94% rename from StabilityMatrix/Extensions/LiteDBExtensions.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Extensions/LiteDBExtensions.cs index b269ac2c..a40b4213 100644 --- a/StabilityMatrix/Extensions/LiteDBExtensions.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Extensions/LiteDBExtensions.cs @@ -1,12 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Reflection; using LiteDB; using LiteDB.Async; -namespace StabilityMatrix.Extensions; +namespace StabilityMatrix.Core.Extensions; // ReSharper disable once InconsistentNaming public static class LiteDBExtensions diff --git a/StabilityMatrix/Helper/Cache/GithubApiCache.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/GithubApiCache.cs similarity index 92% rename from StabilityMatrix/Helper/Cache/GithubApiCache.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/GithubApiCache.cs index 1900d86d..125de4c4 100644 --- a/StabilityMatrix/Helper/Cache/GithubApiCache.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/GithubApiCache.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.Caching.Memory; using Octokit; -namespace StabilityMatrix.Helper.Cache; +namespace StabilityMatrix.Core.Helper.Cache; public class GithubApiCache : IGithubApiCache { diff --git a/StabilityMatrix/Helper/Cache/IGithubApiCache.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/IGithubApiCache.cs similarity index 76% rename from StabilityMatrix/Helper/Cache/IGithubApiCache.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/IGithubApiCache.cs index 955311e6..9c79c803 100644 --- a/StabilityMatrix/Helper/Cache/IGithubApiCache.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/IGithubApiCache.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Octokit; +using Octokit; using Refit; -namespace StabilityMatrix.Helper.Cache; +namespace StabilityMatrix.Core.Helper.Cache; public interface IGithubApiCache { diff --git a/StabilityMatrix/Helper/Cache/LRUCache.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/LRUCache.cs similarity index 93% rename from StabilityMatrix/Helper/Cache/LRUCache.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/LRUCache.cs index 77d81390..f8796144 100644 --- a/StabilityMatrix/Helper/Cache/LRUCache.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Cache/LRUCache.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; -namespace StabilityMatrix.Helper.Cache; +namespace StabilityMatrix.Core.Helper.Cache; // ReSharper disable once InconsistentNaming public class LRUCache where TK : notnull diff --git a/StabilityMatrix/Helper/Expressions.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Expressions.cs similarity index 93% rename from StabilityMatrix/Helper/Expressions.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/Expressions.cs index 1d433b2a..c830d645 100644 --- a/StabilityMatrix/Helper/Expressions.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Expressions.cs @@ -1,8 +1,7 @@ -using System; -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Reflection; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class Expressions { diff --git a/StabilityMatrix/Helper/FileHash.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileHash.cs similarity index 96% rename from StabilityMatrix/Helper/FileHash.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileHash.cs index 16e3b5f5..a29d87c0 100644 --- a/StabilityMatrix/Helper/FileHash.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileHash.cs @@ -1,12 +1,9 @@ -using System; -using System.Buffers; -using System.IO; +using System.Buffers; using System.Security.Cryptography; -using System.Threading.Tasks; using Blake3; using StabilityMatrix.Core.Models.Progress; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class FileHash { diff --git a/StabilityMatrix/Helper/FileTransfers.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileTransfers.cs similarity index 93% rename from StabilityMatrix/Helper/FileTransfers.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileTransfers.cs index acd44fb4..9f2fa56d 100644 --- a/StabilityMatrix/Helper/FileTransfers.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/FileTransfers.cs @@ -1,12 +1,7 @@ -using System; -using System.Buffers; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; +using System.Buffers; using StabilityMatrix.Core.Models.Progress; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class FileTransfers { diff --git a/StabilityMatrix/Helper/HardwareHelper.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/HardwareHelper.cs similarity index 80% rename from StabilityMatrix/Helper/HardwareHelper.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/HardwareHelper.cs index 62907589..5f810b45 100644 --- a/StabilityMatrix/Helper/HardwareHelper.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/HardwareHelper.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Microsoft.Win32; +using Microsoft.Win32; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class HardwareHelper { @@ -82,25 +78,6 @@ public static class HardwareHelper } } -[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] -public static class Size -{ - public const ulong KiB = 1024; - public const ulong MiB = KiB * 1024; - public const ulong GiB = MiB * 1024; - - public static string FormatBytes(ulong bytes) - { - return bytes switch - { - < KiB => $"{bytes} B", - < MiB => $"{bytes / (double) KiB:0.0} KiB", - < GiB => $"{bytes / (double) MiB:0.0} MiB", - _ => $"{bytes / (double) GiB:0.0} GiB" - }; - } -} - public enum Level { Unknown, diff --git a/StabilityMatrix/Helper/MinimumDelay.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/MinimumDelay.cs similarity index 90% rename from StabilityMatrix/Helper/MinimumDelay.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/MinimumDelay.cs index acf6e160..35820565 100644 --- a/StabilityMatrix/Helper/MinimumDelay.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/MinimumDelay.cs @@ -1,8 +1,6 @@ -using System; -using System.Diagnostics; -using System.Threading.Tasks; +using System.Diagnostics; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; /// /// Enforces a minimum delay if the function returns too quickly. diff --git a/StabilityMatrix/Helper/ObjectHash.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ObjectHash.cs similarity index 87% rename from StabilityMatrix/Helper/ObjectHash.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/ObjectHash.cs index c841a413..f29bc35a 100644 --- a/StabilityMatrix/Helper/ObjectHash.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ObjectHash.cs @@ -1,8 +1,7 @@ -using System; -using System.Text; +using System.Text; using System.Text.Json; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public class ObjectHash { diff --git a/StabilityMatrix/Helper/ProcessRunner.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessRunner.cs similarity index 96% rename from StabilityMatrix/Helper/ProcessRunner.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessRunner.cs index 9a5ca1f9..76aa10aa 100644 --- a/StabilityMatrix/Helper/ProcessRunner.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessRunner.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System.Diagnostics; using System.Text; -using System.Threading; -using System.Threading.Tasks; using NLog; using StabilityMatrix.Core.Exceptions; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class ProcessRunner { diff --git a/StabilityMatrix/Helper/ProcessTracker.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessTracker.cs similarity index 97% rename from StabilityMatrix/Helper/ProcessTracker.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessTracker.cs index b827ef0f..b5d02e2a 100644 --- a/StabilityMatrix/Helper/ProcessTracker.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/ProcessTracker.cs @@ -1,10 +1,10 @@ -using System; -using System.ComponentModel; +using System.ComponentModel; using System.Diagnostics; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using NLog; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; /// /// Allows processes to be automatically killed if this parent process unexpectedly quits. @@ -12,6 +12,7 @@ namespace StabilityMatrix.Helper; /// References: /// https://stackoverflow.com/a/4657392/386091 /// https://stackoverflow.com/a/9164742/386091 +[SupportedOSPlatform("windows")] public static class ProcessTracker { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); diff --git a/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Size.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Size.cs new file mode 100644 index 00000000..e9edb1ac --- /dev/null +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Size.cs @@ -0,0 +1,22 @@ +using System.Diagnostics.CodeAnalysis; + +namespace StabilityMatrix.Core.Helper; + +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public static class Size +{ + public const ulong KiB = 1024; + public const ulong MiB = KiB * 1024; + public const ulong GiB = MiB * 1024; + + public static string FormatBytes(ulong bytes) + { + return bytes switch + { + < KiB => $"{bytes} B", + < MiB => $"{bytes / (double) KiB:0.0} KiB", + < GiB => $"{bytes / (double) MiB:0.0} MiB", + _ => $"{bytes / (double) GiB:0.0} GiB" + }; + } +} diff --git a/StabilityMatrix/Helper/SystemInfo.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/SystemInfo.cs similarity index 71% rename from StabilityMatrix/Helper/SystemInfo.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/SystemInfo.cs index 2b810e3d..e8a006d0 100644 --- a/StabilityMatrix/Helper/SystemInfo.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/SystemInfo.cs @@ -1,8 +1,8 @@ using System.Runtime.InteropServices; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; -internal static class SystemInfo +public static class SystemInfo { [DllImport("UXTheme.dll", SetLastError = true, EntryPoint = "#138")] public static extern bool ShouldUseDarkMode(); diff --git a/StabilityMatrix/Helper/Utilities.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Utilities.cs similarity index 94% rename from StabilityMatrix/Helper/Utilities.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Helper/Utilities.cs index 50452ee9..07afca73 100644 --- a/StabilityMatrix/Helper/Utilities.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Helper/Utilities.cs @@ -1,8 +1,6 @@ -using System.IO; -using System.Linq; -using System.Reflection; +using System.Reflection; -namespace StabilityMatrix.Helper; +namespace StabilityMatrix.Core.Helper; public static class Utilities { diff --git a/StabilityMatrix/Models/Configs/DebugOptions.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/Configs/DebugOptions.cs similarity index 91% rename from StabilityMatrix/Models/Configs/DebugOptions.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/Configs/DebugOptions.cs index 9dbc659b..788fc466 100644 --- a/StabilityMatrix/Models/Configs/DebugOptions.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/Configs/DebugOptions.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.Models.Configs; +namespace StabilityMatrix.Core.Models.Configs; public class DebugOptions { diff --git a/StabilityMatrix/Models/FileInterfaces/DirectoryPath.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/DirectoryPath.cs similarity index 96% rename from StabilityMatrix/Models/FileInterfaces/DirectoryPath.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/DirectoryPath.cs index 134244d5..201d592e 100644 --- a/StabilityMatrix/Models/FileInterfaces/DirectoryPath.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/DirectoryPath.cs @@ -1,8 +1,4 @@ -using System.IO; -using System.Linq; -using System.Threading.Tasks; - -namespace StabilityMatrix.Models.FileInterfaces; +namespace StabilityMatrix.Core.Models.FileInterfaces; public class DirectoryPath : FileSystemPath, IPathObject { diff --git a/StabilityMatrix/Models/FileInterfaces/FilePath.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FilePath.cs similarity index 95% rename from StabilityMatrix/Models/FileInterfaces/FilePath.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FilePath.cs index 35411166..4e0814e4 100644 --- a/StabilityMatrix/Models/FileInterfaces/FilePath.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FilePath.cs @@ -1,9 +1,6 @@ using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -namespace StabilityMatrix.Models.FileInterfaces; +namespace StabilityMatrix.Core.Models.FileInterfaces; [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public class FilePath : FileSystemPath, IPathObject diff --git a/StabilityMatrix/Models/FileInterfaces/FileSystemPath.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FileSystemPath.cs similarity index 92% rename from StabilityMatrix/Models/FileInterfaces/FileSystemPath.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FileSystemPath.cs index 272ae6cb..ad572e7e 100644 --- a/StabilityMatrix/Models/FileInterfaces/FileSystemPath.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/FileSystemPath.cs @@ -1,7 +1,4 @@ -using System; -using System.IO; - -namespace StabilityMatrix.Models.FileInterfaces; +namespace StabilityMatrix.Core.Models.FileInterfaces; public class FileSystemPath : IEquatable, IEquatable { diff --git a/StabilityMatrix/Models/FileInterfaces/IPathObject.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/IPathObject.cs similarity index 90% rename from StabilityMatrix/Models/FileInterfaces/IPathObject.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/IPathObject.cs index 4dfcd33b..065d6691 100644 --- a/StabilityMatrix/Models/FileInterfaces/IPathObject.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileInterfaces/IPathObject.cs @@ -1,6 +1,4 @@ -using System.Threading.Tasks; - -namespace StabilityMatrix.Models.FileInterfaces; +namespace StabilityMatrix.Core.Models.FileInterfaces; public interface IPathObject { diff --git a/StabilityMatrix/Models/FileSizeType.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileSizeType.cs similarity index 95% rename from StabilityMatrix/Models/FileSizeType.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/FileSizeType.cs index 9edcf63b..2ddf15bb 100644 --- a/StabilityMatrix/Models/FileSizeType.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/FileSizeType.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public class FileSizeType { diff --git a/StabilityMatrix/Models/GlobalConfig.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/GlobalConfig.cs similarity index 91% rename from StabilityMatrix/Models/GlobalConfig.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/GlobalConfig.cs index 90fe0781..cb2d9eea 100644 --- a/StabilityMatrix/Models/GlobalConfig.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/GlobalConfig.cs @@ -1,7 +1,6 @@ -using System; -using StabilityMatrix.Models.FileInterfaces; +using StabilityMatrix.Core.Models.FileInterfaces; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public static class GlobalConfig { diff --git a/StabilityMatrix/Models/InstalledPackage.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/InstalledPackage.cs similarity index 96% rename from StabilityMatrix/Models/InstalledPackage.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/InstalledPackage.cs index 38fcf920..2f8ef880 100644 --- a/StabilityMatrix/Models/InstalledPackage.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/InstalledPackage.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.Json.Serialization; -using System.Threading.Tasks; -using StabilityMatrix.Helper; +using System.Text.Json.Serialization; +using StabilityMatrix.Core.Helper; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; /// /// Profile information for a user-installed package. diff --git a/StabilityMatrix/Models/LaunchOption.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOption.cs similarity index 93% rename from StabilityMatrix/Models/LaunchOption.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOption.cs index 1597e806..0a22910b 100644 --- a/StabilityMatrix/Models/LaunchOption.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOption.cs @@ -1,9 +1,8 @@ -using System; -using System.Text.Json.Serialization; -using StabilityMatrix.Converters.Json; -using StabilityMatrix.Helper; +using System.Text.Json.Serialization; +using StabilityMatrix.Core.Converters.Json; +using StabilityMatrix.Core.Helper; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public class LaunchOption { diff --git a/StabilityMatrix/Models/LaunchOptionCard.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionCard.cs similarity index 95% rename from StabilityMatrix/Models/LaunchOptionCard.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionCard.cs index f0ec1149..7b66ea8d 100644 --- a/StabilityMatrix/Models/LaunchOptionCard.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionCard.cs @@ -1,6 +1,6 @@ using System.Collections.ObjectModel; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public class LaunchOptionCard { diff --git a/StabilityMatrix/Models/LaunchOptionDefinition.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionDefinition.cs similarity index 93% rename from StabilityMatrix/Models/LaunchOptionDefinition.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionDefinition.cs index e33b4365..e534bcad 100644 --- a/StabilityMatrix/Models/LaunchOptionDefinition.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionDefinition.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; /// /// Defines a launch option for a BasePackage. diff --git a/StabilityMatrix/Models/LaunchOptionType.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionType.cs similarity index 60% rename from StabilityMatrix/Models/LaunchOptionType.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionType.cs index 58e03ecf..4ba00501 100644 --- a/StabilityMatrix/Models/LaunchOptionType.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LaunchOptionType.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public enum LaunchOptionType { diff --git a/StabilityMatrix/Models/LicenseInfo.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LicenseInfo.cs similarity index 84% rename from StabilityMatrix/Models/LicenseInfo.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LicenseInfo.cs index 144de571..54a40e72 100644 --- a/StabilityMatrix/Models/LicenseInfo.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LicenseInfo.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public class LicenseInfo { diff --git a/StabilityMatrix/Models/LoadState.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LoadState.cs similarity index 61% rename from StabilityMatrix/Models/LoadState.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/LoadState.cs index ac04fac3..65c1b1e8 100644 --- a/StabilityMatrix/Models/LoadState.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/LoadState.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public enum LoadState { diff --git a/StabilityMatrix/Models/PackageVersion.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/PackageVersion.cs similarity index 75% rename from StabilityMatrix/Models/PackageVersion.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/PackageVersion.cs index 8d0cf806..edc8f2bd 100644 --- a/StabilityMatrix/Models/PackageVersion.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/PackageVersion.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public class PackageVersion { diff --git a/StabilityMatrix/Models/SharedFolderType.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/SharedFolderType.cs similarity index 87% rename from StabilityMatrix/Models/SharedFolderType.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/SharedFolderType.cs index fd641812..bace308d 100644 --- a/StabilityMatrix/Models/SharedFolderType.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/SharedFolderType.cs @@ -1,7 +1,6 @@ -using System; -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; [SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "IdentifierTypo")] diff --git a/StabilityMatrix/Models/TaskResult.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Models/TaskResult.cs similarity index 88% rename from StabilityMatrix/Models/TaskResult.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Models/TaskResult.cs index 72f7498e..d325c552 100644 --- a/StabilityMatrix/Models/TaskResult.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Models/TaskResult.cs @@ -1,7 +1,6 @@ -using System; -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; -namespace StabilityMatrix.Models; +namespace StabilityMatrix.Core.Models; public readonly record struct TaskResult { diff --git a/StabilityMatrix/Python/ArgParser.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Python/ArgParser.cs similarity index 96% rename from StabilityMatrix/Python/ArgParser.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Python/ArgParser.cs index 329f2247..68e9ccec 100644 --- a/StabilityMatrix/Python/ArgParser.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Python/ArgParser.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using NLog; +using NLog; using Python.Runtime; -using StabilityMatrix.Models; +using StabilityMatrix.Core.Models; -namespace StabilityMatrix.Python; +namespace StabilityMatrix.Core.Python; /// /// Extracts command arguments from Python source file. diff --git a/StabilityMatrix/Python/IPyRunner.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Python/IPyRunner.cs similarity index 94% rename from StabilityMatrix/Python/IPyRunner.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Python/IPyRunner.cs index b29b3cf7..b3e8bf73 100644 --- a/StabilityMatrix/Python/IPyRunner.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Python/IPyRunner.cs @@ -1,9 +1,4 @@ -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace StabilityMatrix.Python; +namespace StabilityMatrix.Core.Python; public interface IPyRunner { diff --git a/StabilityMatrix/Python/Interop/PyIOStream.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Python/Interop/PyIOStream.cs similarity index 89% rename from StabilityMatrix/Python/Interop/PyIOStream.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Python/Interop/PyIOStream.cs index 0a8a19b5..127fc64f 100644 --- a/StabilityMatrix/Python/Interop/PyIOStream.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Python/Interop/PyIOStream.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; +using System.Diagnostics.CodeAnalysis; using System.Text; -namespace StabilityMatrix.Python.Interop; +namespace StabilityMatrix.Core.Python.Interop; /// /// Implement the interface of the sys.stdout redirection diff --git a/StabilityMatrix/Python/PyRunner.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Python/PyRunner.cs similarity index 97% rename from StabilityMatrix/Python/PyRunner.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Python/PyRunner.cs index 6cb155b5..75bdef23 100644 --- a/StabilityMatrix/Python/PyRunner.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Python/PyRunner.cs @@ -1,13 +1,9 @@ -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using NLog; +using NLog; using Python.Runtime; -using StabilityMatrix.Helper; -using StabilityMatrix.Python.Interop; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Python.Interop; -namespace StabilityMatrix.Python; +namespace StabilityMatrix.Core.Python; public record struct PyVersionInfo(int Major, int Minor, int Micro, string ReleaseLevel, int Serial); diff --git a/StabilityMatrix/Python/PyVenvRunner.cs b/StabilityMatrix.Core/StabilityMatrix.Core/Python/PyVenvRunner.cs similarity index 96% rename from StabilityMatrix/Python/PyVenvRunner.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/Python/PyVenvRunner.cs index 47fa36d7..59356b10 100644 --- a/StabilityMatrix/Python/PyVenvRunner.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/Python/PyVenvRunner.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; +using System.Diagnostics; using NLog; using Salaros.Configuration; -using StabilityMatrix.Helper; -using StabilityMatrix.Models.FileInterfaces; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models.FileInterfaces; -namespace StabilityMatrix.Python; +namespace StabilityMatrix.Core.Python; /// /// Python runner using a subprocess, mainly for venv support. diff --git a/StabilityMatrix/ReparsePoints/DeviceIoControlCode.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/DeviceIoControlCode.cs similarity index 93% rename from StabilityMatrix/ReparsePoints/DeviceIoControlCode.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/DeviceIoControlCode.cs index 1bf50171..2c07dc8f 100644 --- a/StabilityMatrix/ReparsePoints/DeviceIoControlCode.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/DeviceIoControlCode.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; internal enum DeviceIoControlCode : uint { diff --git a/StabilityMatrix/ReparsePoints/Junction.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Junction.cs similarity index 99% rename from StabilityMatrix/ReparsePoints/Junction.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Junction.cs index f0ab0977..05a6a1dc 100644 --- a/StabilityMatrix/ReparsePoints/Junction.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Junction.cs @@ -1,13 +1,11 @@ -using System; -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using Microsoft.Win32.SafeHandles; -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; [SupportedOSPlatform("windows")] public static class Junction diff --git a/StabilityMatrix/ReparsePoints/ReparseDataBuffer.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/ReparseDataBuffer.cs similarity index 97% rename from StabilityMatrix/ReparsePoints/ReparseDataBuffer.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/ReparseDataBuffer.cs index fb8f4906..68c6f81a 100644 --- a/StabilityMatrix/ReparsePoints/ReparseDataBuffer.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/ReparseDataBuffer.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; /// /// Because the tag we're using is IO_REPARSE_TAG_MOUNT_POINT, diff --git a/StabilityMatrix/ReparsePoints/Win32CreationDisposition.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32CreationDisposition.cs similarity index 75% rename from StabilityMatrix/ReparsePoints/Win32CreationDisposition.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32CreationDisposition.cs index 7c59e311..85de7751 100644 --- a/StabilityMatrix/ReparsePoints/Win32CreationDisposition.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32CreationDisposition.cs @@ -1,4 +1,4 @@ -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; internal enum Win32CreationDisposition : uint { diff --git a/StabilityMatrix/ReparsePoints/Win32ErrorCode.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32ErrorCode.cs similarity index 70% rename from StabilityMatrix/ReparsePoints/Win32ErrorCode.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32ErrorCode.cs index 63bf629d..3f661481 100644 --- a/StabilityMatrix/ReparsePoints/Win32ErrorCode.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32ErrorCode.cs @@ -1,36 +1,34 @@ -using StabilityMatrix.Extensions; - -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; internal enum Win32ErrorCode { /// /// The file or directory is not a reparse point. + /// ERROR_NOT_A_REPARSE_POINT /// - [StringValue("ERROR_NOT_A_REPARSE_POINT")] NotAReparsePoint = 4390, /// /// The reparse point attribute cannot be set because it conflicts with an existing attribute. + /// ERROR_REPARSE_ATTRIBUTE_CONFLICT /// - [StringValue("ERROR_REPARSE_ATTRIBUTE_CONFLICT")] ReparseAttributeConflict = 4391, /// /// The data present in the reparse point buffer is invalid. + /// ERROR_INVALID_REPARSE_DATA /// - [StringValue("ERROR_INVALID_REPARSE_DATA")] InvalidReparseData = 4392, /// /// The tag present in the reparse point buffer is invalid. + /// ERROR_REPARSE_TAG_INVALID /// - [StringValue("ERROR_REPARSE_TAG_INVALID")] ReparseTagInvalid = 4393, /// /// There is a mismatch between the tag specified in the request and the tag present in the reparse point. + /// ERROR_REPARSE_TAG_MISMATCH /// - [StringValue("ERROR_REPARSE_TAG_MISMATCH")] ReparseTagMismatch = 4394, } diff --git a/StabilityMatrix/ReparsePoints/Win32FileAccess.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAccess.cs similarity index 74% rename from StabilityMatrix/ReparsePoints/Win32FileAccess.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAccess.cs index 1258f08c..8b1432a8 100644 --- a/StabilityMatrix/ReparsePoints/Win32FileAccess.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAccess.cs @@ -1,6 +1,4 @@ -using System; - -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; [Flags] internal enum Win32FileAccess : uint diff --git a/StabilityMatrix/ReparsePoints/Win32FileAttribute.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAttribute.cs similarity index 95% rename from StabilityMatrix/ReparsePoints/Win32FileAttribute.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAttribute.cs index ea2754a7..faa7693a 100644 --- a/StabilityMatrix/ReparsePoints/Win32FileAttribute.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileAttribute.cs @@ -1,7 +1,6 @@ -using System; -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; [Flags] [SuppressMessage("ReSharper", "InconsistentNaming")] diff --git a/StabilityMatrix/ReparsePoints/Win32FileShare.cs b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileShare.cs similarity index 70% rename from StabilityMatrix/ReparsePoints/Win32FileShare.cs rename to StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileShare.cs index 37e43ea1..f58c2722 100644 --- a/StabilityMatrix/ReparsePoints/Win32FileShare.cs +++ b/StabilityMatrix.Core/StabilityMatrix.Core/ReparsePoints/Win32FileShare.cs @@ -1,6 +1,4 @@ -using System; - -namespace StabilityMatrix.ReparsePoints; +namespace StabilityMatrix.Core.ReparsePoints; [Flags] internal enum Win32FileShare : uint diff --git a/StabilityMatrix.Core/StabilityMatrix.Core/StabilityMatrix.Core.csproj b/StabilityMatrix.Core/StabilityMatrix.Core/StabilityMatrix.Core.csproj index 6836c680..01267220 100644 --- a/StabilityMatrix.Core/StabilityMatrix.Core/StabilityMatrix.Core.csproj +++ b/StabilityMatrix.Core/StabilityMatrix.Core/StabilityMatrix.Core.csproj @@ -6,4 +6,26 @@ enable + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Tests/Models/InstalledPackageTests.cs b/StabilityMatrix.Tests/Models/InstalledPackageTests.cs index 4fe4985c..510e42f2 100644 --- a/StabilityMatrix.Tests/Models/InstalledPackageTests.cs +++ b/StabilityMatrix.Tests/Models/InstalledPackageTests.cs @@ -1,4 +1,5 @@ -using StabilityMatrix.Models; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Models; namespace StabilityMatrix.Tests.Models; diff --git a/StabilityMatrix.Tests/Models/SharedFoldersTests.cs b/StabilityMatrix.Tests/Models/SharedFoldersTests.cs index a372db93..5684b31c 100644 --- a/StabilityMatrix.Tests/Models/SharedFoldersTests.cs +++ b/StabilityMatrix.Tests/Models/SharedFoldersTests.cs @@ -1,4 +1,5 @@ -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; namespace StabilityMatrix.Tests.Models; diff --git a/StabilityMatrix.Tests/Python/PyRunnerTests.cs b/StabilityMatrix.Tests/Python/PyRunnerTests.cs index 71cc0090..f7738864 100644 --- a/StabilityMatrix.Tests/Python/PyRunnerTests.cs +++ b/StabilityMatrix.Tests/Python/PyRunnerTests.cs @@ -1,5 +1,5 @@ using Python.Runtime; -using StabilityMatrix.Python; +using StabilityMatrix.Core.Python; namespace StabilityMatrix.Tests.Python; diff --git a/StabilityMatrix.Tests/ReparsePoints/JunctionTests.cs b/StabilityMatrix.Tests/ReparsePoints/JunctionTests.cs index 34615c60..3182fb14 100644 --- a/StabilityMatrix.Tests/ReparsePoints/JunctionTests.cs +++ b/StabilityMatrix.Tests/ReparsePoints/JunctionTests.cs @@ -1,5 +1,5 @@ using Microsoft.VisualBasic; -using StabilityMatrix.ReparsePoints; +using StabilityMatrix.Core.ReparsePoints; namespace StabilityMatrix.Tests.ReparsePoints; diff --git a/StabilityMatrix/App.xaml.cs b/StabilityMatrix/App.xaml.cs index d9168a04..3f2d5b4e 100644 --- a/StabilityMatrix/App.xaml.cs +++ b/StabilityMatrix/App.xaml.cs @@ -27,13 +27,13 @@ using Polly.Timeout; using Refit; using Sentry; using StabilityMatrix.Api; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models.Configs; +using StabilityMatrix.Core.Python; using StabilityMatrix.Database; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; using StabilityMatrix.Models; -using StabilityMatrix.Models.Configs; using StabilityMatrix.Models.Packages; -using StabilityMatrix.Python; using StabilityMatrix.Services; using StabilityMatrix.Updater; using StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/Database/LiteDbContext.cs b/StabilityMatrix/Database/LiteDbContext.cs index 3b56a6f0..82d5d34c 100644 --- a/StabilityMatrix/Database/LiteDbContext.cs +++ b/StabilityMatrix/Database/LiteDbContext.cs @@ -5,10 +5,10 @@ using System.Linq; using System.Threading.Tasks; using LiteDB.Async; using Microsoft.Extensions.Options; -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models.Configs; using StabilityMatrix.Helper; using StabilityMatrix.Models.Api; -using StabilityMatrix.Models.Configs; namespace StabilityMatrix.Database; diff --git a/StabilityMatrix/Helper/ArchiveHelper.cs b/StabilityMatrix/Helper/ArchiveHelper.cs index ff5aef68..866bd3df 100644 --- a/StabilityMatrix/Helper/ArchiveHelper.cs +++ b/StabilityMatrix/Helper/ArchiveHelper.cs @@ -9,6 +9,7 @@ using System.Windows.Threading; using NLog; using SharpCompress.Common; using SharpCompress.Readers; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Progress; namespace StabilityMatrix.Helper; diff --git a/StabilityMatrix/Helper/DialogFactory.cs b/StabilityMatrix/Helper/DialogFactory.cs index 4bb4860f..a63a67b5 100644 --- a/StabilityMatrix/Helper/DialogFactory.cs +++ b/StabilityMatrix/Helper/DialogFactory.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; using StabilityMatrix.Services; using StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/Helper/IDialogFactory.cs b/StabilityMatrix/Helper/IDialogFactory.cs index 9894abcc..556e0a84 100644 --- a/StabilityMatrix/Helper/IDialogFactory.cs +++ b/StabilityMatrix/Helper/IDialogFactory.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; namespace StabilityMatrix.Helper; diff --git a/StabilityMatrix/Helper/ISettingsManager.cs b/StabilityMatrix/Helper/ISettingsManager.cs index 1e625b85..29b66f20 100644 --- a/StabilityMatrix/Helper/ISettingsManager.cs +++ b/StabilityMatrix/Helper/ISettingsManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq.Expressions; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; using StabilityMatrix.Models.Settings; using Wpf.Ui.Controls.Window; diff --git a/StabilityMatrix/Helper/ISnackbarService.cs b/StabilityMatrix/Helper/ISnackbarService.cs index 674894ae..43e5213f 100644 --- a/StabilityMatrix/Helper/ISnackbarService.cs +++ b/StabilityMatrix/Helper/ISnackbarService.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; using Wpf.Ui.Common; using Wpf.Ui.Controls; diff --git a/StabilityMatrix/Helper/PrerequisiteHelper.cs b/StabilityMatrix/Helper/PrerequisiteHelper.cs index 909154d6..b0377c62 100644 --- a/StabilityMatrix/Helper/PrerequisiteHelper.cs +++ b/StabilityMatrix/Helper/PrerequisiteHelper.cs @@ -8,8 +8,9 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Win32; using Octokit; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Progress; -using StabilityMatrix.Python; +using StabilityMatrix.Core.Python; using StabilityMatrix.Services; namespace StabilityMatrix.Helper; diff --git a/StabilityMatrix/Helper/SettingsManager.cs b/StabilityMatrix/Helper/SettingsManager.cs index 6cb349d9..2510b075 100644 --- a/StabilityMatrix/Helper/SettingsManager.cs +++ b/StabilityMatrix/Helper/SettingsManager.cs @@ -12,9 +12,11 @@ using System.Threading.Tasks; using AsyncAwaitBestPractices; using NLog; using Refit; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Python; using StabilityMatrix.Models; using StabilityMatrix.Models.Settings; -using StabilityMatrix.Python; using Wpf.Ui.Controls.Window; namespace StabilityMatrix.Helper; diff --git a/StabilityMatrix/Helper/SnackbarService.cs b/StabilityMatrix/Helper/SnackbarService.cs index fc562812..683e0090 100644 --- a/StabilityMatrix/Helper/SnackbarService.cs +++ b/StabilityMatrix/Helper/SnackbarService.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using System; using AsyncAwaitBestPractices; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; using StabilityMatrix.ViewModels; using Wpf.Ui.Common; diff --git a/StabilityMatrix/InstallerWindow.xaml b/StabilityMatrix/InstallerWindow.xaml index 4f1603ec..6904752f 100644 --- a/StabilityMatrix/InstallerWindow.xaml +++ b/StabilityMatrix/InstallerWindow.xaml @@ -20,14 +20,14 @@ xmlns:converters="clr-namespace:StabilityMatrix.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:models="clr-namespace:StabilityMatrix.Models" xmlns:octokit="clr-namespace:Octokit;assembly=Octokit" xmlns:packages="clr-namespace:StabilityMatrix.Models.Packages" xmlns:system="clr-namespace:System;assembly=System.Runtime" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:xaml="clr-namespace:MdXaml;assembly=MdXaml"> + xmlns:xaml="clr-namespace:MdXaml;assembly=MdXaml" + xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"> diff --git a/StabilityMatrix/LaunchOptionsDialog.xaml b/StabilityMatrix/LaunchOptionsDialog.xaml index a8874a0f..442bd617 100644 --- a/StabilityMatrix/LaunchOptionsDialog.xaml +++ b/StabilityMatrix/LaunchOptionsDialog.xaml @@ -16,7 +16,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:StabilityMatrix" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:models="clr-namespace:StabilityMatrix.Models" + xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> diff --git a/StabilityMatrix/LaunchOptionsDialog.xaml.cs b/StabilityMatrix/LaunchOptionsDialog.xaml.cs index efc7c65a..f3c5ae79 100644 --- a/StabilityMatrix/LaunchOptionsDialog.xaml.cs +++ b/StabilityMatrix/LaunchOptionsDialog.xaml.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Windows; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; using StabilityMatrix.ViewModels; using Wpf.Ui.Contracts; diff --git a/StabilityMatrix/LaunchPage.xaml b/StabilityMatrix/LaunchPage.xaml index aede0b34..27acf4fd 100644 --- a/StabilityMatrix/LaunchPage.xaml +++ b/StabilityMatrix/LaunchPage.xaml @@ -14,10 +14,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:designViewModels="clr-namespace:StabilityMatrix.DesignData" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:models="clr-namespace:StabilityMatrix.Models" + xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" + xmlns:terminal="clr-namespace:Simple.Wpf.Terminal;assembly=Simple.Wpf.Terminal" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:terminal="clr-namespace:Simple.Wpf.Terminal;assembly=Simple.Wpf.Terminal"> + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> diff --git a/StabilityMatrix/Models/Api/CivitModel.cs b/StabilityMatrix/Models/Api/CivitModel.cs index af5c3838..f356017c 100644 --- a/StabilityMatrix/Models/Api/CivitModel.cs +++ b/StabilityMatrix/Models/Api/CivitModel.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Text.Json.Serialization; using LiteDB; +using StabilityMatrix.Core.Models; namespace StabilityMatrix.Models.Api; diff --git a/StabilityMatrix/Models/Api/CivitModelType.cs b/StabilityMatrix/Models/Api/CivitModelType.cs index 29c9a169..f2e6fede 100644 --- a/StabilityMatrix/Models/Api/CivitModelType.cs +++ b/StabilityMatrix/Models/Api/CivitModelType.cs @@ -1,7 +1,8 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; -using StabilityMatrix.Converters.Json; -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Converters.Json; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models; namespace StabilityMatrix.Models.Api; diff --git a/StabilityMatrix/Models/CheckpointFile.cs b/StabilityMatrix/Models/CheckpointFile.cs index 19c264cd..c1ca8d48 100644 --- a/StabilityMatrix/Models/CheckpointFile.cs +++ b/StabilityMatrix/Models/CheckpointFile.cs @@ -11,8 +11,9 @@ using AsyncAwaitBestPractices; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using NLog; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Progress; -using StabilityMatrix.Extensions; using StabilityMatrix.Helper; namespace StabilityMatrix.Models; diff --git a/StabilityMatrix/Models/CheckpointFolder.cs b/StabilityMatrix/Models/CheckpointFolder.cs index 08a6ce24..af964c5d 100644 --- a/StabilityMatrix/Models/CheckpointFolder.cs +++ b/StabilityMatrix/Models/CheckpointFolder.cs @@ -8,10 +8,12 @@ using System.Threading.Tasks; using System.Windows; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Models.FileInterfaces; using StabilityMatrix.Core.Models.Progress; -using StabilityMatrix.Extensions; using StabilityMatrix.Helper; -using StabilityMatrix.Models.FileInterfaces; using StabilityMatrix.Services; using StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/Models/GlobalUserSecrets.cs b/StabilityMatrix/Models/GlobalUserSecrets.cs index 8eccaf41..b48c7a73 100644 --- a/StabilityMatrix/Models/GlobalUserSecrets.cs +++ b/StabilityMatrix/Models/GlobalUserSecrets.cs @@ -8,7 +8,8 @@ using System.Security.Cryptography; using System.Security.Principal; using System.Text.Json; using System.Text.Json.Serialization; -using StabilityMatrix.Models.FileInterfaces; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Models.FileInterfaces; namespace StabilityMatrix.Models; diff --git a/StabilityMatrix/Models/ISharedFolders.cs b/StabilityMatrix/Models/ISharedFolders.cs index cca55e90..ae79bee2 100644 --- a/StabilityMatrix/Models/ISharedFolders.cs +++ b/StabilityMatrix/Models/ISharedFolders.cs @@ -1,4 +1,4 @@ -using StabilityMatrix.Models.FileInterfaces; +using StabilityMatrix.Core.Models.FileInterfaces; using StabilityMatrix.Models.Packages; namespace StabilityMatrix.Models; diff --git a/StabilityMatrix/Models/Packages/A3WebUI.cs b/StabilityMatrix/Models/Packages/A3WebUI.cs index 044d2b10..4e2253ab 100644 --- a/StabilityMatrix/Models/Packages/A3WebUI.cs +++ b/StabilityMatrix/Models/Packages/A3WebUI.cs @@ -6,9 +6,11 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; using StabilityMatrix.Services; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Packages/BaseGitPackage.cs b/StabilityMatrix/Models/Packages/BaseGitPackage.cs index 47a8e13c..54d64ba6 100644 --- a/StabilityMatrix/Models/Packages/BaseGitPackage.cs +++ b/StabilityMatrix/Models/Packages/BaseGitPackage.cs @@ -7,10 +7,11 @@ using System.Linq; using System.Threading.Tasks; using NLog; using Octokit; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; -using StabilityMatrix.Python; using StabilityMatrix.Services; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Packages/BasePackage.cs b/StabilityMatrix/Models/Packages/BasePackage.cs index e83f20fd..49ec89d7 100644 --- a/StabilityMatrix/Models/Packages/BasePackage.cs +++ b/StabilityMatrix/Models/Packages/BasePackage.cs @@ -3,7 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Octokit; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using PackageVersion = StabilityMatrix.Core.Models.PackageVersion; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Packages/ComfyUI.cs b/StabilityMatrix/Models/Packages/ComfyUI.cs index 948de873..507219f7 100644 --- a/StabilityMatrix/Models/Packages/ComfyUI.cs +++ b/StabilityMatrix/Models/Packages/ComfyUI.cs @@ -6,9 +6,11 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using NLog; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; using StabilityMatrix.Services; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Packages/DankDiffusion.cs b/StabilityMatrix/Models/Packages/DankDiffusion.cs index 24263df5..05ad5446 100644 --- a/StabilityMatrix/Models/Packages/DankDiffusion.cs +++ b/StabilityMatrix/Models/Packages/DankDiffusion.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; using StabilityMatrix.Services; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Packages/VladAutomatic.cs b/StabilityMatrix/Models/Packages/VladAutomatic.cs index 376559ec..2d911582 100644 --- a/StabilityMatrix/Models/Packages/VladAutomatic.cs +++ b/StabilityMatrix/Models/Packages/VladAutomatic.cs @@ -7,10 +7,12 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using NLog; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; -using StabilityMatrix.Helper.Cache; -using StabilityMatrix.Python; using StabilityMatrix.Services; namespace StabilityMatrix.Models.Packages; diff --git a/StabilityMatrix/Models/Settings/Settings.cs b/StabilityMatrix/Models/Settings/Settings.cs index 69060db9..38721da6 100644 --- a/StabilityMatrix/Models/Settings/Settings.cs +++ b/StabilityMatrix/Models/Settings/Settings.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using StabilityMatrix.Core.Models; using Wpf.Ui.Controls.Window; namespace StabilityMatrix.Models.Settings; diff --git a/StabilityMatrix/Models/SharedFolders.cs b/StabilityMatrix/Models/SharedFolders.cs index 73244cf4..e845e15d 100644 --- a/StabilityMatrix/Models/SharedFolders.cs +++ b/StabilityMatrix/Models/SharedFolders.cs @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.IO; using NLog; -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Models.FileInterfaces; +using StabilityMatrix.Core.ReparsePoints; using StabilityMatrix.Helper; -using StabilityMatrix.Models.FileInterfaces; using StabilityMatrix.Models.Packages; -using StabilityMatrix.ReparsePoints; namespace StabilityMatrix.Models; diff --git a/StabilityMatrix/PackageManagerPage.xaml b/StabilityMatrix/PackageManagerPage.xaml index 1691bc3e..95952b6d 100644 --- a/StabilityMatrix/PackageManagerPage.xaml +++ b/StabilityMatrix/PackageManagerPage.xaml @@ -12,7 +12,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:models="clr-namespace:StabilityMatrix.Models" + xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> diff --git a/StabilityMatrix/Updater/UpdateChannel.cs b/StabilityMatrix/Updater/UpdateChannel.cs index 891bfef1..94a3a09a 100644 --- a/StabilityMatrix/Updater/UpdateChannel.cs +++ b/StabilityMatrix/Updater/UpdateChannel.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using StabilityMatrix.Converters.Json; +using StabilityMatrix.Core.Converters.Json; namespace StabilityMatrix.Updater; diff --git a/StabilityMatrix/Updater/UpdateHelper.cs b/StabilityMatrix/Updater/UpdateHelper.cs index 07995f42..a5792aa1 100644 --- a/StabilityMatrix/Updater/UpdateHelper.cs +++ b/StabilityMatrix/Updater/UpdateHelper.cs @@ -7,10 +7,10 @@ using System.Threading.Tasks; using System.Windows.Threading; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models.Configs; using StabilityMatrix.Core.Models.Progress; -using StabilityMatrix.Extensions; using StabilityMatrix.Helper; -using StabilityMatrix.Models.Configs; using StabilityMatrix.Services; namespace StabilityMatrix.Updater; diff --git a/StabilityMatrix/ViewModels/CheckpointBrowserCardViewModel.cs b/StabilityMatrix/ViewModels/CheckpointBrowserCardViewModel.cs index ea0ad18f..6f6f42d8 100644 --- a/StabilityMatrix/ViewModels/CheckpointBrowserCardViewModel.cs +++ b/StabilityMatrix/ViewModels/CheckpointBrowserCardViewModel.cs @@ -10,12 +10,14 @@ using AsyncAwaitBestPractices; using CommunityToolkit.Mvvm.Input; using NLog; using Refit; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Models.FileInterfaces; using StabilityMatrix.Core.Models.Progress; -using StabilityMatrix.Extensions; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Api; -using StabilityMatrix.Models.FileInterfaces; using StabilityMatrix.Services; using Wpf.Ui.Controls; diff --git a/StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs b/StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs index 2f0edeff..d81676b4 100644 --- a/StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs +++ b/StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs @@ -12,8 +12,10 @@ using System.Diagnostics; using System.Net.Http; using System.Windows.Data; using StabilityMatrix.Api; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; using StabilityMatrix.Database; -using StabilityMatrix.Extensions; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Api; diff --git a/StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs b/StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs index c8123203..3ff4bee0 100644 --- a/StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs +++ b/StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs @@ -5,10 +5,11 @@ using System.Threading.Tasks; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using NLog; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models.FileInterfaces; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; using StabilityMatrix.Models; -using StabilityMatrix.Models.FileInterfaces; -using StabilityMatrix.Python; namespace StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/ViewModels/FirstLaunchSetupViewModel.cs b/StabilityMatrix/ViewModels/FirstLaunchSetupViewModel.cs index 7c3f171d..8c1f2462 100644 --- a/StabilityMatrix/ViewModels/FirstLaunchSetupViewModel.cs +++ b/StabilityMatrix/ViewModels/FirstLaunchSetupViewModel.cs @@ -4,6 +4,7 @@ using AsyncAwaitBestPractices; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using StabilityMatrix.Controls; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Helper; namespace StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/ViewModels/InstallerViewModel.cs b/StabilityMatrix/ViewModels/InstallerViewModel.cs index 93b76a57..26af1c50 100644 --- a/StabilityMatrix/ViewModels/InstallerViewModel.cs +++ b/StabilityMatrix/ViewModels/InstallerViewModel.cs @@ -11,11 +11,12 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Logging; using Octokit; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Packages; -using StabilityMatrix.Python; using StabilityMatrix.Services; using Wpf.Ui.Contracts; using Wpf.Ui.Controls; @@ -24,7 +25,7 @@ using Wpf.Ui.Controls.Window; using Application = System.Windows.Application; using EventManager = StabilityMatrix.Helper.EventManager; using ISnackbarService = StabilityMatrix.Helper.ISnackbarService; -using PackageVersion = StabilityMatrix.Models.PackageVersion; +using PackageVersion = StabilityMatrix.Core.Models.PackageVersion; namespace StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/ViewModels/LaunchOptionsDialogViewModel.cs b/StabilityMatrix/ViewModels/LaunchOptionsDialogViewModel.cs index 5f4d758f..574a46ab 100644 --- a/StabilityMatrix/ViewModels/LaunchOptionsDialogViewModel.cs +++ b/StabilityMatrix/ViewModels/LaunchOptionsDialogViewModel.cs @@ -6,7 +6,8 @@ using System.Diagnostics; using System.Linq; using CommunityToolkit.Mvvm.ComponentModel; using NLog; -using StabilityMatrix.Helper.Cache; +using StabilityMatrix.Core.Helper.Cache; +using StabilityMatrix.Core.Models; using StabilityMatrix.Models; namespace StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/ViewModels/LaunchViewModel.cs b/StabilityMatrix/ViewModels/LaunchViewModel.cs index 227bb51d..65977cb2 100644 --- a/StabilityMatrix/ViewModels/LaunchViewModel.cs +++ b/StabilityMatrix/ViewModels/LaunchViewModel.cs @@ -9,10 +9,12 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Logging; using Microsoft.Toolkit.Uwp.Notifications; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Packages; -using StabilityMatrix.Python; using Wpf.Ui.Contracts; using Wpf.Ui.Controls.ContentDialogControl; using EventManager = StabilityMatrix.Helper.EventManager; diff --git a/StabilityMatrix/ViewModels/MainWindowViewModel.cs b/StabilityMatrix/ViewModels/MainWindowViewModel.cs index 9857cf3e..9fd8226c 100644 --- a/StabilityMatrix/ViewModels/MainWindowViewModel.cs +++ b/StabilityMatrix/ViewModels/MainWindowViewModel.cs @@ -10,8 +10,9 @@ using AsyncAwaitBestPractices; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Options; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models.Configs; using StabilityMatrix.Helper; -using StabilityMatrix.Models.Configs; using StabilityMatrix.Services; using StabilityMatrix.Updater; using Wpf.Ui.Appearance; diff --git a/StabilityMatrix/ViewModels/OneClickInstallViewModel.cs b/StabilityMatrix/ViewModels/OneClickInstallViewModel.cs index 307a3a53..e4a375ef 100644 --- a/StabilityMatrix/ViewModels/OneClickInstallViewModel.cs +++ b/StabilityMatrix/ViewModels/OneClickInstallViewModel.cs @@ -4,11 +4,12 @@ using System.Windows; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Logging; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using StabilityMatrix.Core.Python; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Packages; -using StabilityMatrix.Python; using EventManager = StabilityMatrix.Helper.EventManager; namespace StabilityMatrix.ViewModels; diff --git a/StabilityMatrix/ViewModels/PackageManagerViewModel.cs b/StabilityMatrix/ViewModels/PackageManagerViewModel.cs index cd47b0b3..d5f8f8ea 100644 --- a/StabilityMatrix/ViewModels/PackageManagerViewModel.cs +++ b/StabilityMatrix/ViewModels/PackageManagerViewModel.cs @@ -11,6 +11,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Logging; using Polly; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; using Wpf.Ui.Contracts; using Wpf.Ui.Controls; diff --git a/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs b/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs index 2c07fd3b..ef9ee06d 100644 --- a/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs +++ b/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs @@ -9,6 +9,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using NLog; using Ookii.Dialogs.Wpf; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Progress; using StabilityMatrix.Helper; using StabilityMatrix.Models.Settings; diff --git a/StabilityMatrix/ViewModels/SettingsViewModel.cs b/StabilityMatrix/ViewModels/SettingsViewModel.cs index b3e7af88..30af067f 100644 --- a/StabilityMatrix/ViewModels/SettingsViewModel.cs +++ b/StabilityMatrix/ViewModels/SettingsViewModel.cs @@ -20,11 +20,13 @@ using Ookii.Dialogs.Wpf; using Polly.Timeout; using Refit; using StabilityMatrix.Api; +using StabilityMatrix.Core.Helper; +using StabilityMatrix.Core.Models; using StabilityMatrix.Core.Models.Progress; +using StabilityMatrix.Core.Python; using StabilityMatrix.Database; using StabilityMatrix.Helper; using StabilityMatrix.Models; -using StabilityMatrix.Python; using Wpf.Ui.Appearance; using Wpf.Ui.Contracts; using Wpf.Ui.Controls; diff --git a/StabilityMatrix/ViewModels/TextToImageViewModel.cs b/StabilityMatrix/ViewModels/TextToImageViewModel.cs index 8e86d023..36f5a5a9 100644 --- a/StabilityMatrix/ViewModels/TextToImageViewModel.cs +++ b/StabilityMatrix/ViewModels/TextToImageViewModel.cs @@ -9,7 +9,8 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.Logging; using StabilityMatrix.Api; -using StabilityMatrix.Extensions; +using StabilityMatrix.Core.Extensions; +using StabilityMatrix.Core.Models; using StabilityMatrix.Helper; using StabilityMatrix.Models; using StabilityMatrix.Models.Api; diff --git a/StabilityMatrix/ViewModels/UpdateWindowViewModel.cs b/StabilityMatrix/ViewModels/UpdateWindowViewModel.cs index 266559f4..1c8150dd 100644 --- a/StabilityMatrix/ViewModels/UpdateWindowViewModel.cs +++ b/StabilityMatrix/ViewModels/UpdateWindowViewModel.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using System.Windows; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Progress; using StabilityMatrix.Helper; using StabilityMatrix.Updater;