diff --git a/Files.sln b/Files.sln index a43a3173b312..93b61efa9c03 100644 --- a/Files.sln +++ b/Files.sln @@ -409,16 +409,16 @@ Global GlobalSection(NestedProjects) = preSolution {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} = {A74DCE98-A744-4D71-A2B1-7EE4FED0936B} {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} = {A74DCE98-A744-4D71-A2B1-7EE4FED0936B} - {94F77692-D47C-48D8-A1A7-645192EF38A4} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} + {94F77692-D47C-48D8-A1A7-645192EF38A4} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} {B8051E11-5BF2-49F7-A7C8-E3820DBB8209} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} {74704E22-9A09-4675-AE35-7896DE81EC4A} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} - {BB1DA0B0-4E5B-4336-961E-DF389482C094} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} + {BB1DA0B0-4E5B-4336-961E-DF389482C094} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0} = {481DE2EA-E6CE-4A9C-A220-3B543B95AAA1} {A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} {6F431D82-A5FF-4833-B5E4-702E1E523126} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} + {8F60FD8E-1921-47D6-97B0-D26D7B3A4999} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} {6FA07816-DE0A-4D49-84E8-38E953A33C87} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/src/Files.App/App.xaml.cs b/src/Files.App/App.xaml.cs index cec3e31e49b8..8291940dd4a8 100644 --- a/src/Files.App/App.xaml.cs +++ b/src/Files.App/App.xaml.cs @@ -21,10 +21,8 @@ using Files.App.ViewModels.Settings; using Files.Core.Services.SizeProvider; using Files.Core.Storage; +using Files.Core.Utils.Cloud; using Files.Shared; -using Files.Shared.Cloud; -using Files.Shared.Services; -using Files.Shared.Services.DateTimeFormatter; using Microsoft.AppCenter; using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; diff --git a/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs b/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs index b0ea2e072994..d80c303f3ffb 100644 --- a/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs +++ b/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Services.DateTimeFormatter; using Microsoft.UI.Xaml.Data; namespace Files.App.Converters diff --git a/src/Files.App/Data/Items/ListedItem.cs b/src/Files.App/Data/Items/ListedItem.cs index 10d395719f41..0c06c7d93eba 100644 --- a/src/Files.App/Data/Items/ListedItem.cs +++ b/src/Files.App/Data/Items/ListedItem.cs @@ -6,7 +6,6 @@ using Files.App.ViewModels.Properties; using Files.Core.Helpers; using Files.Core.ViewModels.FileTags; -using Files.Shared.Services.DateTimeFormatter; using FluentFTP; using Microsoft.UI; using Microsoft.UI.Xaml; diff --git a/src/Files.App/Data/Models/IStatusCenterActions.cs b/src/Files.App/Data/Models/IStatusCenterActions.cs index 3824f902c982..b8e6538fb4e9 100644 --- a/src/Files.App/Data/Models/IStatusCenterActions.cs +++ b/src/Files.App/Data/Models/IStatusCenterActions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using Files.App.ViewModels; -using Files.Shared.Enums; using System; using System.Threading; diff --git a/src/Files.App/Data/Models/ItemViewModel.cs b/src/Files.App/Data/Models/ItemViewModel.cs index 73951ae3e3a5..364883362fe5 100644 --- a/src/Files.App/Data/Models/ItemViewModel.cs +++ b/src/Files.App/Data/Models/ItemViewModel.cs @@ -4,9 +4,7 @@ using Files.App.Helpers.StorageCache; using Files.App.ViewModels.Previews; using Files.Core.Services.SizeProvider; -using Files.Shared.Cloud; -using Files.Shared.EventArguments; -using Files.Shared.Services; +using FluentFTP; using LibGit2Sharp; using Microsoft.Extensions.Logging; using Microsoft.UI.Xaml.Data; diff --git a/src/Files.App/Dialogs/AddItemDialog.xaml.cs b/src/Files.App/Dialogs/AddItemDialog.xaml.cs index bf0f87109b9b..794209e2da6e 100644 --- a/src/Files.App/Dialogs/AddItemDialog.xaml.cs +++ b/src/Files.App/Dialogs/AddItemDialog.xaml.cs @@ -5,7 +5,6 @@ using Files.Core.Services; using Files.Core.ViewModels.Dialogs; using Files.Core.ViewModels.Dialogs.AddItemDialog; -using Files.Shared.Enums; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using System; diff --git a/src/Files.App/Dialogs/CreateShortcutDialog.xaml.cs b/src/Files.App/Dialogs/CreateShortcutDialog.xaml.cs index f4db803a0ca7..18153d53f165 100644 --- a/src/Files.App/Dialogs/CreateShortcutDialog.xaml.cs +++ b/src/Files.App/Dialogs/CreateShortcutDialog.xaml.cs @@ -3,7 +3,6 @@ using Files.App.ViewModels.Dialogs; using Files.Core.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Data; using System; diff --git a/src/Files.App/Dialogs/DynamicDialog.xaml.cs b/src/Files.App/Dialogs/DynamicDialog.xaml.cs index 4b466be367d2..1e5da1e52352 100644 --- a/src/Files.App/Dialogs/DynamicDialog.xaml.cs +++ b/src/Files.App/Dialogs/DynamicDialog.xaml.cs @@ -3,7 +3,6 @@ using Files.App.Helpers; using Files.App.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml.Controls; using System; using System.Threading.Tasks; diff --git a/src/Files.App/Dialogs/ElevateConfirmDialog.xaml.cs b/src/Files.App/Dialogs/ElevateConfirmDialog.xaml.cs index db8c9e74427e..6c029120ca44 100644 --- a/src/Files.App/Dialogs/ElevateConfirmDialog.xaml.cs +++ b/src/Files.App/Dialogs/ElevateConfirmDialog.xaml.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using Files.Core.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml.Controls; using System; using System.Threading.Tasks; diff --git a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs index a7bb94deb52b..87150d4d7fd0 100644 --- a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs +++ b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs @@ -5,7 +5,6 @@ using Files.App.Utils; using Files.Core.ViewModels.Dialogs; using Files.Core.ViewModels.Dialogs.FileSystemDialog; -using Files.Shared.Enums; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; diff --git a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs index 1cbd419208c4..d982115daac7 100644 --- a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs +++ b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs @@ -6,7 +6,6 @@ using Files.App.Extensions; using Files.App.ViewModels.Dialogs; using Files.Core.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Input; diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml.cs b/src/Files.App/Dialogs/SettingsDialog.xaml.cs index 6ad9e8aaa0e8..63176ca71b45 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml.cs +++ b/src/Files.App/Dialogs/SettingsDialog.xaml.cs @@ -3,7 +3,6 @@ using Files.App.Views.Settings; using Files.Core.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using System; diff --git a/src/Files.App/GlobalUsings.cs b/src/Files.App/GlobalUsings.cs index 6ea4f4173631..0a8d90ab7571 100644 --- a/src/Files.App/GlobalUsings.cs +++ b/src/Files.App/GlobalUsings.cs @@ -13,13 +13,13 @@ global using global::System.Diagnostics; global using SystemIO = global::System.IO; -// Windows Community Toolkit +// CommunityToolkit.Mvvm global using global::CommunityToolkit.Mvvm.ComponentModel; global using global::CommunityToolkit.Mvvm.DependencyInjection; global using global::CommunityToolkit.Mvvm.Input; global using global::CommunityToolkit.Mvvm.Messaging; -// Files Front-end +// Files.App global using global::Files.App.Commands; global using global::Files.App.Contexts; global using global::Files.App.Helpers; @@ -52,28 +52,26 @@ global using global::Files.App.Views.Shells; // Files.Core -global using global::Files.Core.CommandLine; global using global::Files.Core.Data.Enums; +global using global::Files.Core.Data.EventArguments; +global using global::Files.Core.Data.Items; global using global::Files.Core.Data.Messages; global using global::Files.Core.Data.Models; global using global::Files.Core.Extensions; global using global::Files.Core.Helpers; global using global::Files.Core.Services; +global using global::Files.Core.Services.DateTimeFormatter; global using global::Files.Core.Services.Settings; -//global using global::Files.Core.Services.SizeProvider; global using global::Files.Core.ViewModels; global using global::Files.Core.ViewModels.Dialogs; global using global::Files.Core.ViewModels.Dialogs.AddItemDialog; global using global::Files.Core.ViewModels.Dialogs.FileSystemDialog; global using global::Files.Core.ViewModels.FileTags; global using global::Files.Core.ViewModels.Widgets; +global using global::Files.Core.Utils; +global using global::Files.Core.Utils.Cloud; +global using global::Files.Core.Utils.CommandLine; // Files.Shared global using global::Files.Shared; -global using global::Files.Shared.Enums; global using global::Files.Shared.Extensions; - -// Files Back-end - -// Vanara -//global using global::Vanara.PInvoke; diff --git a/src/Files.App/Helpers/Dialog/DialogDisplayHelper.cs b/src/Files.App/Helpers/Dialog/DialogDisplayHelper.cs index 1b3c47893858..94791f70a458 100644 --- a/src/Files.App/Helpers/Dialog/DialogDisplayHelper.cs +++ b/src/Files.App/Helpers/Dialog/DialogDisplayHelper.cs @@ -3,7 +3,6 @@ using Files.App.Dialogs; using Files.App.ViewModels.Dialogs; -using Files.Shared.Enums; using Microsoft.UI.Xaml.Controls; using System; using System.Threading.Tasks; diff --git a/src/Files.App/Helpers/Dialog/DynamicDialogFactory.cs b/src/Files.App/Helpers/Dialog/DynamicDialogFactory.cs index 9dfaa810fa45..274471662613 100644 --- a/src/Files.App/Helpers/Dialog/DynamicDialogFactory.cs +++ b/src/Files.App/Helpers/Dialog/DynamicDialogFactory.cs @@ -132,7 +132,7 @@ public static DynamicDialog GetFor_RenameDialog() return dialog; } - public static DynamicDialog GetFor_FileInUseDialog(List lockingProcess = null) + public static DynamicDialog GetFor_FileInUseDialog(List lockingProcess = null) { DynamicDialog dialog = new DynamicDialog(new DynamicDialogViewModel() { diff --git a/src/Files.App/Helpers/EnumConversionHelpers.cs b/src/Files.App/Helpers/EnumConversionHelpers.cs index 82f396d6e493..941798bb94f5 100644 --- a/src/Files.App/Helpers/EnumConversionHelpers.cs +++ b/src/Files.App/Helpers/EnumConversionHelpers.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using Windows.Storage; namespace Files.App.Helpers diff --git a/src/Files.App/Helpers/Navigation/NavigationHelpers.cs b/src/Files.App/Helpers/Navigation/NavigationHelpers.cs index 04e5c0a30420..d71f0d01d1c2 100644 --- a/src/Files.App/Helpers/Navigation/NavigationHelpers.cs +++ b/src/Files.App/Helpers/Navigation/NavigationHelpers.cs @@ -11,7 +11,6 @@ using Files.Core.Helpers; using Files.Core.Services.Settings; using Files.Shared; -using Files.Shared.Enums; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; diff --git a/src/Files.App/Helpers/PostBannerHelpers.cs b/src/Files.App/Helpers/PostBannerHelpers.cs index a45dd33e0005..403ce2ee8641 100644 --- a/src/Files.App/Helpers/PostBannerHelpers.cs +++ b/src/Files.App/Helpers/PostBannerHelpers.cs @@ -5,7 +5,6 @@ using Files.App.Extensions; using Files.App.Utils; using Files.App.ViewModels; -using Files.Shared.Enums; using System.Collections.Generic; using System.Linq; using System.Threading; diff --git a/src/Files.App/Helpers/Storage/ErrorCodeConverter.cs b/src/Files.App/Helpers/Storage/ErrorCodeConverter.cs index 207e14cdf9da..0b63b9372bc4 100644 --- a/src/Files.App/Helpers/Storage/ErrorCodeConverter.cs +++ b/src/Files.App/Helpers/Storage/ErrorCodeConverter.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; - namespace Files.App.Helpers { public static class ErrorCodeConverter diff --git a/src/Files.App/Helpers/Storage/StorageHelpers.cs b/src/Files.App/Helpers/Storage/StorageHelpers.cs index c1f8ca74696b..bedfe3b2bab6 100644 --- a/src/Files.App/Helpers/Storage/StorageHelpers.cs +++ b/src/Files.App/Helpers/Storage/StorageHelpers.cs @@ -4,7 +4,6 @@ using Files.App.Utils; using Files.App.Utils.StorageItems; using Files.Core.Helpers; -using Files.Shared.Enums; using System; using System.Diagnostics; using System.Runtime.InteropServices; diff --git a/src/Files.App/Helpers/Storage/StorageItemIconHelpers.cs b/src/Files.App/Helpers/Storage/StorageItemIconHelpers.cs index 512c4149edce..54740fc7f10b 100644 --- a/src/Files.App/Helpers/Storage/StorageItemIconHelpers.cs +++ b/src/Files.App/Helpers/Storage/StorageItemIconHelpers.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using System; using System.Threading.Tasks; using Windows.Storage; diff --git a/src/Files.App/Helpers/StorageItemCollection/GroupingHelper.cs b/src/Files.App/Helpers/StorageItemCollection/GroupingHelper.cs index aa4f17b8b247..d097819988f4 100644 --- a/src/Files.App/Helpers/StorageItemCollection/GroupingHelper.cs +++ b/src/Files.App/Helpers/StorageItemCollection/GroupingHelper.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Services.DateTimeFormatter; using Windows.Storage; namespace Files.App.Helpers diff --git a/src/Files.App/Helpers/StorageItemCollection/SortingHelper.cs b/src/Files.App/Helpers/StorageItemCollection/SortingHelper.cs index 8c87ad0196b8..8ad6b1ec4aea 100644 --- a/src/Files.App/Helpers/StorageItemCollection/SortingHelper.cs +++ b/src/Files.App/Helpers/StorageItemCollection/SortingHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils; -using Files.Shared.Enums; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Files.App/Helpers/UI/AppSystemBackdrop.cs b/src/Files.App/Helpers/UI/AppSystemBackdrop.cs index 58515424cea0..d61a625dd10d 100644 --- a/src/Files.App/Helpers/UI/AppSystemBackdrop.cs +++ b/src/Files.App/Helpers/UI/AppSystemBackdrop.cs @@ -64,7 +64,7 @@ protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop userSettingsService.OnSettingChangedEvent -= OnSettingChanged; } - private void OnSettingChanged(object? sender, Shared.EventArguments.SettingChangedEventArgs e) + private void OnSettingChanged(object? sender, SettingChangedEventArgs e) { if (target is null) return; diff --git a/src/Files.App/Helpers/UI/JumpListHelper.cs b/src/Files.App/Helpers/UI/JumpListHelper.cs index a644ffb4db89..5f76bd943ad0 100644 --- a/src/Files.App/Helpers/UI/JumpListHelper.cs +++ b/src/Files.App/Helpers/UI/JumpListHelper.cs @@ -3,7 +3,6 @@ using CommunityToolkit.Mvvm.DependencyInjection; using Files.App.UserControls.Widgets; -using Files.Shared.Services; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; diff --git a/src/Files.App/Helpers/UI/UIHelpers.cs b/src/Files.App/Helpers/UI/UIHelpers.cs index 62fc05f63925..3ec1a4fd2dae 100644 --- a/src/Files.App/Helpers/UI/UIHelpers.cs +++ b/src/Files.App/Helpers/UI/UIHelpers.cs @@ -6,7 +6,6 @@ using Files.App.Utils.Shell; using Files.Core.ViewModels.Dialogs; using Files.Shared; -using Files.Shared.Enums; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Media.Imaging; diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index 05bd29028ebc..3e2fdc0c808b 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See the LICENSE. using Files.App.UserControls.MultitaskingControl; +using Files.Core.Utils.CommandLine; using Microsoft.UI; using Microsoft.UI.Windowing; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/Services/DateTimeFormatter/AbstractDateTimeFormatter.cs b/src/Files.App/Services/DateTimeFormatter/AbstractDateTimeFormatter.cs index cff58a09f8c6..448cb2f7cfd3 100644 --- a/src/Files.App/Services/DateTimeFormatter/AbstractDateTimeFormatter.cs +++ b/src/Files.App/Services/DateTimeFormatter/AbstractDateTimeFormatter.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Services.DateTimeFormatter; using System.Globalization; using Windows.Globalization; diff --git a/src/Files.App/Services/DateTimeFormatter/DateTimeFormatterFactory.cs b/src/Files.App/Services/DateTimeFormatter/DateTimeFormatterFactory.cs index 976c957860a1..27e4d6cb8f9d 100644 --- a/src/Files.App/Services/DateTimeFormatter/DateTimeFormatterFactory.cs +++ b/src/Files.App/Services/DateTimeFormatter/DateTimeFormatterFactory.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; -using Files.Shared.Services.DateTimeFormatter; using System; namespace Files.App.Services.DateTimeFormatter diff --git a/src/Files.App/Services/DateTimeFormatter/UserDateTimeFormatter.cs b/src/Files.App/Services/DateTimeFormatter/UserDateTimeFormatter.cs index 19eec594c978..fd79e1d538f7 100644 --- a/src/Files.App/Services/DateTimeFormatter/UserDateTimeFormatter.cs +++ b/src/Files.App/Services/DateTimeFormatter/UserDateTimeFormatter.cs @@ -1,9 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.EventArguments; -using Files.Shared.Services.DateTimeFormatter; - namespace Files.App.Services.DateTimeFormatter { internal class UserDateTimeFormatter : IDateTimeFormatter diff --git a/src/Files.App/Services/DialogService.cs b/src/Files.App/Services/DialogService.cs index 7dc577fdb613..186674b87d8a 100644 --- a/src/Files.App/Services/DialogService.cs +++ b/src/Files.App/Services/DialogService.cs @@ -7,7 +7,6 @@ using Files.Core.ViewModels.Dialogs; using Files.Core.ViewModels.Dialogs.AddItemDialog; using Files.Core.ViewModels.Dialogs.FileSystemDialog; -using Files.Shared.Enums; using Microsoft.Extensions.Logging; using Microsoft.UI.Xaml.Controls; using Windows.Foundation.Metadata; diff --git a/src/Files.App/Services/JumpListService.cs b/src/Files.App/Services/JumpListService.cs index e1cff4af098b..92b8fa1051ad 100644 --- a/src/Files.App/Services/JumpListService.cs +++ b/src/Files.App/Services/JumpListService.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Services; using System.IO; using Windows.Storage; using Windows.UI.StartScreen; diff --git a/src/Files.App/Services/Settings/AppSettingsService.cs b/src/Files.App/Services/Settings/AppSettingsService.cs index f1c69330e2ce..b74acf7f0815 100644 --- a/src/Files.App/Services/Settings/AppSettingsService.cs +++ b/src/Files.App/Services/Settings/AppSettingsService.cs @@ -3,7 +3,6 @@ using Files.App.Utils.Serialization; using Files.Core.Services.Settings; -using Files.Shared.EventArguments; using Microsoft.AppCenter.Analytics; namespace Files.App.Services.Settings diff --git a/src/Files.App/Services/Settings/AppearanceSettingsService.cs b/src/Files.App/Services/Settings/AppearanceSettingsService.cs index eec19068b82b..688f2223bb68 100644 --- a/src/Files.App/Services/Settings/AppearanceSettingsService.cs +++ b/src/Files.App/Services/Settings/AppearanceSettingsService.cs @@ -3,7 +3,6 @@ using Files.App.Utils.Serialization; using Files.Core.Services.Settings; -using Files.Shared.EventArguments; using Microsoft.AppCenter.Analytics; using Microsoft.UI.Composition.SystemBackdrops; using System; diff --git a/src/Files.App/Services/Settings/FoldersSettingsService.cs b/src/Files.App/Services/Settings/FoldersSettingsService.cs index 122df04e240d..d24ba7f1c0ec 100644 --- a/src/Files.App/Services/Settings/FoldersSettingsService.cs +++ b/src/Files.App/Services/Settings/FoldersSettingsService.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils.Serialization; -using Files.Shared.EventArguments; using Microsoft.AppCenter.Analytics; namespace Files.App.Services.Settings diff --git a/src/Files.App/Services/Settings/GeneralSettingsService.cs b/src/Files.App/Services/Settings/GeneralSettingsService.cs index 4db7e5c190b7..9b1a8d05f9d7 100644 --- a/src/Files.App/Services/Settings/GeneralSettingsService.cs +++ b/src/Files.App/Services/Settings/GeneralSettingsService.cs @@ -3,8 +3,6 @@ using Files.App.Utils.Serialization; using Files.Core.Services.Settings; -using Files.Shared.Enums; -using Files.Shared.EventArguments; using Microsoft.AppCenter.Analytics; using System.Collections.Generic; diff --git a/src/Files.App/Services/Settings/PreviewPaneSettingsService.cs b/src/Files.App/Services/Settings/PreviewPaneSettingsService.cs index a2b3a5cd815f..088f0bb201b6 100644 --- a/src/Files.App/Services/Settings/PreviewPaneSettingsService.cs +++ b/src/Files.App/Services/Settings/PreviewPaneSettingsService.cs @@ -3,7 +3,6 @@ using Files.App.Utils.Serialization; using Files.Core.Services.Settings; -using Files.Shared.EventArguments; using Microsoft.AppCenter.Analytics; using System; diff --git a/src/Files.App/Services/Settings/UserSettingsService.cs b/src/Files.App/Services/Settings/UserSettingsService.cs index 099a731ebc19..900d0ed178a4 100644 --- a/src/Files.App/Services/Settings/UserSettingsService.cs +++ b/src/Files.App/Services/Settings/UserSettingsService.cs @@ -5,7 +5,6 @@ using Files.App.Utils.Serialization; using Files.App.Utils.Serialization.Implementation; using Files.Core.Services.Settings; -using Files.Shared.EventArguments; using Files.Shared.Extensions; using System.Collections.Generic; using System.IO; diff --git a/src/Files.App/UserControls/DataGridHeader.xaml.cs b/src/Files.App/UserControls/DataGridHeader.xaml.cs index 1081cf3e9d19..119629295537 100644 --- a/src/Files.App/UserControls/DataGridHeader.xaml.cs +++ b/src/Files.App/UserControls/DataGridHeader.xaml.cs @@ -1,15 +1,12 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Input; -// Il modello di elemento Controllo utente è documentato all'indirizzo https://go.microsoft.com/fwlink/?LinkId=234236 - namespace Files.App.UserControls { public sealed partial class DataGridHeader : UserControl, INotifyPropertyChanged diff --git a/src/Files.App/Utils/Archives/ZipHelpers.cs b/src/Files.App/Utils/Archives/ZipHelpers.cs index 94340bafe5a0..faae19c3ec15 100644 --- a/src/Files.App/Utils/Archives/ZipHelpers.cs +++ b/src/Files.App/Utils/Archives/ZipHelpers.cs @@ -87,7 +87,7 @@ public static async Task ExtractArchive(BaseStorageFile archive, BaseStorageFold int entriesFinished = 0; var minimumTime = new DateTime(1); - FileSystemProgress fsProgress = new(progress, true, Shared.Enums.FileSystemStatusCode.InProgress, entriesAmount); + FileSystemProgress fsProgress = new(progress, true, FileSystemStatusCode.InProgress, entriesAmount); fsProgress.Report(); foreach (var entry in fileEntries) diff --git a/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs b/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs index bc2e4220149b..3ee4d04c21af 100644 --- a/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs +++ b/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using Microsoft.UI.Xaml; namespace Files.App.Utils.Cloud diff --git a/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs b/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs index 96ada7be1ee2..6a1ef9f20a7f 100644 --- a/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs +++ b/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils.Shell; -using Files.Shared.Cloud; using Files.Shared.Extensions; using Microsoft.Win32; using System; diff --git a/src/Files.App/Utils/Cloud/CloudDrivesManager.cs b/src/Files.App/Utils/Cloud/CloudDrivesManager.cs index 7953e17fa479..c33761dccc4d 100644 --- a/src/Files.App/Utils/Cloud/CloudDrivesManager.cs +++ b/src/Files.App/Utils/Cloud/CloudDrivesManager.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using Microsoft.Extensions.Logging; using System.Collections.Specialized; using Windows.Storage; diff --git a/src/Files.App/Utils/Cloud/Detector/AbstractCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/AbstractCloudDetector.cs index b72ac031079c..0182b19f3238 100644 --- a/src/Files.App/Utils/Cloud/Detector/AbstractCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/AbstractCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using System.Collections.Generic; using System.Threading.Tasks; diff --git a/src/Files.App/Utils/Cloud/Detector/BoxCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/BoxCloudDetector.cs index 5df4f6ee9af6..f08fe5844e1d 100644 --- a/src/Files.App/Utils/Cloud/Detector/BoxCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/BoxCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using System.IO; using Windows.Storage; diff --git a/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs index c748216302fb..133cf0249c25 100644 --- a/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; namespace Files.App.Utils.Cloud { diff --git a/src/Files.App/Utils/Cloud/Detector/DropBoxCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/DropBoxCloudDetector.cs index 453f76e4580d..27bad51fd729 100644 --- a/src/Files.App/Utils/Cloud/Detector/DropBoxCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/DropBoxCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using System.IO; using System.Text.Json; using Windows.Storage; diff --git a/src/Files.App/Utils/Cloud/Detector/GenericCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/GenericCloudDetector.cs index 7367eb8fdfcf..f2562b2e9615 100644 --- a/src/Files.App/Utils/Cloud/Detector/GenericCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/GenericCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; namespace Files.App.Utils.Cloud { diff --git a/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs index ce32998166c1..d62104da8e06 100644 --- a/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using Microsoft.Data.Sqlite; using System.IO; using Windows.Storage; diff --git a/src/Files.App/Utils/Cloud/Detector/SynologyDriveCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/SynologyDriveCloudDetector.cs index 65023b1c1e95..79437eb9d2c8 100644 --- a/src/Files.App/Utils/Cloud/Detector/SynologyDriveCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/SynologyDriveCloudDetector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Cloud; +using Files.Core.Utils.Cloud; using Microsoft.Data.Sqlite; using System.IO; using Windows.Storage; diff --git a/src/Files.App/Utils/FileTags/FileTagsHelper.cs b/src/Files.App/Utils/FileTags/FileTagsHelper.cs index 5162d470a462..b14d7ceb4132 100644 --- a/src/Files.App/Utils/FileTags/FileTagsHelper.cs +++ b/src/Files.App/Utils/FileTags/FileTagsHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Common; -using Files.App.Utils.StorageItems; using Files.App.Helpers; using Files.App.Utils.Shell; using Files.Shared.Extensions; diff --git a/src/Files.App/Utils/FilesystemOperations/Helpers/FilesystemHelpers.cs b/src/Files.App/Utils/FilesystemOperations/Helpers/FilesystemHelpers.cs index b15bb17e6217..062e916170e7 100644 --- a/src/Files.App/Utils/FilesystemOperations/Helpers/FilesystemHelpers.cs +++ b/src/Files.App/Utils/FilesystemOperations/Helpers/FilesystemHelpers.cs @@ -3,7 +3,6 @@ using Files.Core.Storage; using Files.Core.Storage.Extensions; -using Files.Shared.Services; using Microsoft.Extensions.Logging; using System.IO; using System.Runtime.InteropServices; diff --git a/src/Files.App/Utils/FilesystemOperations/Helpers/IFilesystemHelpers.cs b/src/Files.App/Utils/FilesystemOperations/Helpers/IFilesystemHelpers.cs index 86d634eca70d..bef8b08822de 100644 --- a/src/Files.App/Utils/FilesystemOperations/Helpers/IFilesystemHelpers.cs +++ b/src/Files.App/Utils/FilesystemOperations/Helpers/IFilesystemHelpers.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils.FilesystemHistory; -using Files.Shared.Enums; using System; using System.Collections.Generic; using System.Threading.Tasks; diff --git a/src/Files.App/Utils/FilesystemOperations/ShellFilesystemOperations.cs b/src/Files.App/Utils/FilesystemOperations/ShellFilesystemOperations.cs index f1024886ee6b..ffae93c706a6 100644 --- a/src/Files.App/Utils/FilesystemOperations/ShellFilesystemOperations.cs +++ b/src/Files.App/Utils/FilesystemOperations/ShellFilesystemOperations.cs @@ -5,6 +5,7 @@ using Files.App.Utils.StorageItems; using Files.App.Utils.Shell; using Files.Core.Services; +using Files.Core.Utils.CommandLine; using Files.Core.ViewModels.Dialogs.FileSystemDialog; using System.IO; using Windows.Storage; diff --git a/src/Files.App/Utils/Library/LibraryManager.cs b/src/Files.App/Utils/Library/LibraryManager.cs index e6067534442e..67fc6738a32e 100644 --- a/src/Files.App/Utils/Library/LibraryManager.cs +++ b/src/Files.App/Utils/Library/LibraryManager.cs @@ -4,6 +4,8 @@ using Files.App.Dialogs; using Files.App.Utils.Shell; using Files.App.ViewModels.Dialogs; +using Files.Shared; +using Files.Shared.Extensions; using Microsoft.Extensions.Logging; using Microsoft.UI.Xaml.Controls; using System.Collections.Specialized; diff --git a/src/Files.App/Utils/RecycleBin/RecycleBinHelpers.cs b/src/Files.App/Utils/RecycleBin/RecycleBinHelpers.cs index 320a3097ae52..f3917cc17a50 100644 --- a/src/Files.App/Utils/RecycleBin/RecycleBinHelpers.cs +++ b/src/Files.App/Utils/RecycleBin/RecycleBinHelpers.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils.Shell; using Microsoft.UI.Xaml.Controls; using System.Text.RegularExpressions; using Vanara.PInvoke; diff --git a/src/Files.App/Utils/Serialization/BaseJsonSettings.cs b/src/Files.App/Utils/Serialization/BaseJsonSettings.cs index 4c065d1fbde7..0f9f27fa22b5 100644 --- a/src/Files.App/Utils/Serialization/BaseJsonSettings.cs +++ b/src/Files.App/Utils/Serialization/BaseJsonSettings.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.EventArguments; using System; using System.Runtime.CompilerServices; diff --git a/src/Files.App/Utils/StorageFileHelpers/FilesystemResult.cs b/src/Files.App/Utils/StorageFileHelpers/FilesystemResult.cs index 12a3d2282bf9..e12ad5f37b19 100644 --- a/src/Files.App/Utils/StorageFileHelpers/FilesystemResult.cs +++ b/src/Files.App/Utils/StorageFileHelpers/FilesystemResult.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; - namespace Files.App.Utils { public class FilesystemResult diff --git a/src/Files.App/Utils/StorageHistory/Helpers/StorageHistoryHelpers.cs b/src/Files.App/Utils/StorageHistory/Helpers/StorageHistoryHelpers.cs index 6ba280270a85..bffdca0c9b63 100644 --- a/src/Files.App/Utils/StorageHistory/Helpers/StorageHistoryHelpers.cs +++ b/src/Files.App/Utils/StorageHistory/Helpers/StorageHistoryHelpers.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using System; using System.Threading; using System.Threading.Tasks; diff --git a/src/Files.App/Utils/StorageHistory/IStorageHistory.cs b/src/Files.App/Utils/StorageHistory/IStorageHistory.cs index 62a8f060a51f..960ce92657df 100644 --- a/src/Files.App/Utils/StorageHistory/IStorageHistory.cs +++ b/src/Files.App/Utils/StorageHistory/IStorageHistory.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using System.Collections.Generic; namespace Files.App.Utils.FilesystemHistory diff --git a/src/Files.App/Utils/StorageHistory/IStorageHistoryOperations.cs b/src/Files.App/Utils/StorageHistory/IStorageHistoryOperations.cs index 1ff10af46077..6d2ed379d136 100644 --- a/src/Files.App/Utils/StorageHistory/IStorageHistoryOperations.cs +++ b/src/Files.App/Utils/StorageHistory/IStorageHistoryOperations.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using System; using System.Threading.Tasks; diff --git a/src/Files.App/Utils/StorageHistory/StorageHistory.cs b/src/Files.App/Utils/StorageHistory/StorageHistory.cs index a0a353479292..86086f48be67 100644 --- a/src/Files.App/Utils/StorageHistory/StorageHistory.cs +++ b/src/Files.App/Utils/StorageHistory/StorageHistory.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using Files.Shared.Extensions; using System.Collections.Generic; diff --git a/src/Files.App/Utils/StorageHistory/StorageHistoryOperations.cs b/src/Files.App/Utils/StorageHistory/StorageHistoryOperations.cs index 168e97d7aac3..815e40af3d1f 100644 --- a/src/Files.App/Utils/StorageHistory/StorageHistoryOperations.cs +++ b/src/Files.App/Utils/StorageHistory/StorageHistoryOperations.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using Files.App.Helpers; -using Files.Shared.Enums; using Files.Shared.Extensions; using System; using System.Collections.Generic; diff --git a/src/Files.App/Utils/WallpaperHelpers.cs b/src/Files.App/Utils/WallpaperHelpers.cs index 147999040ac5..2dde14759868 100644 --- a/src/Files.App/Utils/WallpaperHelpers.cs +++ b/src/Files.App/Utils/WallpaperHelpers.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; using System; using System.Linq; using System.Threading.Tasks; diff --git a/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs b/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs index 2c6d6c01c334..ba5bb449a232 100644 --- a/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs +++ b/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs @@ -3,7 +3,6 @@ using Files.App.Utils.StorageItems; using Files.App.ViewModels.Properties; -using Files.Shared.Services.DateTimeFormatter; using Microsoft.UI.Xaml.Media.Imaging; using System.IO; using Windows.Storage.FileProperties; diff --git a/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs index df0fcd3687a9..c7137b825581 100644 --- a/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs +++ b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Files.App.Utils; @@ -143,7 +146,7 @@ public LocalizedEnumHelper HighDpiOverride } public List> HighDpiOptionList { get; } = Enum.GetValues(typeof(HighDpiOption)).Cast().Select(x => new LocalizedEnumHelper(x)).ToList(); - public List> HighDpiOverrideList { get; } = Enum.GetValues(typeof(HighDpiOverride)).Cast().Where(x => x != Shared.HighDpiOverride.Advanced).Select(x => new LocalizedEnumHelper(x)).ToList(); + public List> HighDpiOverrideList { get; } = Enum.GetValues(typeof(HighDpiOverride)).Cast().Where(x => x != Core.Data.Items.HighDpiOverride.Advanced).Select(x => new LocalizedEnumHelper(x)).ToList(); public List> OSCompatibilityList { get; } = Enum.GetValues(typeof(OSCompatibility)).Cast().Select(x => new LocalizedEnumHelper(x)).ToList(); public List> ReducedColorModeList { get; } = Enum.GetValues(typeof(ReducedColorMode)).Cast().Select(x => new LocalizedEnumHelper(x)).ToList(); diff --git a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs index 573a83b1f351..012fc6bd3cb8 100644 --- a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs @@ -1,5 +1,4 @@ using Files.Core.Extensions; -using Files.Shared.Services.DateTimeFormatter; using Microsoft.UI.Dispatching; using System.IO; using Windows.Storage.FileProperties; diff --git a/src/Files.App/ViewModels/Properties/Items/LibraryProperties.cs b/src/Files.App/ViewModels/Properties/Items/LibraryProperties.cs index 44e106f88260..107ce00982ba 100644 --- a/src/Files.App/ViewModels/Properties/Items/LibraryProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/LibraryProperties.cs @@ -3,7 +3,6 @@ using Files.App.Utils; using Files.App.Utils.StorageItems; using Files.App.Helpers; -using Files.Shared.Services.DateTimeFormatter; using Microsoft.Extensions.Logging; using Microsoft.UI.Dispatching; using System; diff --git a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs index 755acf11d3af..7da5ab86fb11 100644 --- a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs +++ b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Services.DateTimeFormatter; using Microsoft.Extensions.Logging; using System.Collections.Specialized; using System.Globalization; diff --git a/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs b/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs index 6e1dc0c798a1..c728bd1366d6 100644 --- a/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs @@ -5,8 +5,7 @@ using Files.App.UserControls.FilePreviews; using Files.App.ViewModels.Previews; using Files.Core.Helpers; -using Files.Shared.Cloud; -using Files.Shared.EventArguments; +using Files.Core.Utils.Cloud; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using System.Windows.Input; diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index 8327205d7f3b..92496aa659c3 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -1,7 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.EventArguments; using Microsoft.UI.Dispatching; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs index b6357d2737e2..124ea7204897 100644 --- a/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using CommunityToolkit.WinUI.UI; -using Files.Shared.EventArguments; using Microsoft.UI.Dispatching; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/Views/LayoutModes/BaseLayout.cs b/src/Files.App/Views/LayoutModes/BaseLayout.cs index a164acc2f08d..fd6bff28b7a6 100644 --- a/src/Files.App/Views/LayoutModes/BaseLayout.cs +++ b/src/Files.App/Views/LayoutModes/BaseLayout.cs @@ -23,7 +23,7 @@ using Windows.System; using static Files.App.Helpers.PathNormalization; using DispatcherQueueTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer; -using SortDirection = Files.Shared.Enums.SortDirection; +using SortDirection = Files.Core.Data.Enums.SortDirection; using VanaraWindowsShell = Vanara.Windows.Shell; namespace Files.App.Views.LayoutModes diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs index c9e6c1ab2bcf..df1e7f2e16f1 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs @@ -13,7 +13,7 @@ using Windows.Storage; using Windows.System; using Windows.UI.Core; -using SortDirection = Files.Shared.Enums.SortDirection; +using SortDirection = Files.Core.Data.Enums.SortDirection; namespace Files.App.Views.LayoutModes { diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index 768dac88d10b..ea8b3bed7318 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -11,7 +11,6 @@ using Files.App.UserControls; using Files.App.UserControls.MultitaskingControl; using Files.Core.Extensions; -using Files.Shared.EventArguments; using Microsoft.Extensions.Logging; using Microsoft.UI.Input; using Microsoft.UI.Xaml; diff --git a/src/Files.App/Views/Properties/CustomizationPage.xaml b/src/Files.App/Views/Properties/CustomizationPage.xaml index aaf37ac7fc5a..5775997b0e3c 100644 --- a/src/Files.App/Views/Properties/CustomizationPage.xaml +++ b/src/Files.App/Views/Properties/CustomizationPage.xaml @@ -3,10 +3,10 @@ x:Class="Files.App.Views.Properties.CustomizationPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:coredataitems="using:Files.Core.Data.Items" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:shared="using:Files.Shared" xmlns:toolkitconverters="using:CommunityToolkit.WinUI.UI.Converters" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Properties" @@ -103,7 +103,7 @@ ItemsSource="{x:Bind CustomizationViewModel.DllIcons, Mode=OneWay}" SelectedItem="{x:Bind CustomizationViewModel.SelectedDllIcon, Mode=TwoWay}"> - + + /// Uses the application setting. + /// + Application = 0, + + /// + /// Uses the system setting. + /// + System = 1, + + /// + /// Uses universal setting. + /// + Universal = 2, + } +} diff --git a/src/Files.Core/Data/Enums/DeleteConfirmationPolicy.cs b/src/Files.Core/Data/Enums/DeleteConfirmationPolicy.cs new file mode 100644 index 000000000000..73f6021fbbcd --- /dev/null +++ b/src/Files.Core/Data/Enums/DeleteConfirmationPolicy.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum DeleteConfirmationPolicies : byte + { + /// + /// Always ask to confirm. + /// + Always, + + /// + /// Permanent deletion only. + /// + PermanentOnly, + + /// + /// Never ask to confirm. + /// + Never, + } +} diff --git a/src/Files.Core/Data/Enums/DialogResult.cs b/src/Files.Core/Data/Enums/DialogResult.cs new file mode 100644 index 000000000000..3da9951bad21 --- /dev/null +++ b/src/Files.Core/Data/Enums/DialogResult.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum DialogResult + { + /// + /// Unknown result. + /// + None = 0, + + /// + /// The primary button was clicked. + /// + Primary = 1, + + /// + /// The secondary button was clicked. + /// + Secondary = 2 + } +} diff --git a/src/Files.Core/Data/Enums/DynamicDialogButtons.cs b/src/Files.Core/Data/Enums/DynamicDialogButtons.cs new file mode 100644 index 000000000000..0a81d16faf19 --- /dev/null +++ b/src/Files.Core/Data/Enums/DynamicDialogButtons.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum DynamicDialogButtons + { + /// + /// The primary button was clicked. + /// + Primary = 1, + + /// + /// The secondary button was clicked. + /// + Secondary = 2, + + /// + /// The cancel button was clicked. + /// + Cancel = 4, + + /// + /// Unknown result. + /// + None = 8 + } +} diff --git a/src/Files.Core/Data/Enums/DynamicDialogResult.cs b/src/Files.Core/Data/Enums/DynamicDialogResult.cs new file mode 100644 index 000000000000..1b760600605e --- /dev/null +++ b/src/Files.Core/Data/Enums/DynamicDialogResult.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum DynamicDialogResult + { + /// + /// The primary button was clicked. + /// + Primary = 1, + + /// + /// The secondary button was clicked. + /// + Secondary = 2, + + /// + /// The cancel button was clicked. + /// + Cancel = 4, + } +} diff --git a/src/Files.Core/Data/Enums/FileNameConflictResolveOptionType.cs b/src/Files.Core/Data/Enums/FileNameConflictResolveOptionType.cs new file mode 100644 index 000000000000..af9977cf0114 --- /dev/null +++ b/src/Files.Core/Data/Enums/FileNameConflictResolveOptionType.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum FileNameConflictResolveOptionType : uint + { + /// + /// Generate new names. + /// + GenerateNewName = 0, + + /// + /// Replace existing files. + /// + ReplaceExisting = 1, + + /// + /// Skip pasting files. + /// + Skip = 2, + + /// + /// No resolve option were selected. + /// + None = 4 + } +} diff --git a/src/Files.Shared/Enums/FileOperationType.cs b/src/Files.Core/Data/Enums/FileOperationType.cs similarity index 93% rename from src/Files.Shared/Enums/FileOperationType.cs rename to src/Files.Core/Data/Enums/FileOperationType.cs index d8bb7b1ab385..f860a5980217 100644 --- a/src/Files.Shared/Enums/FileOperationType.cs +++ b/src/Files.Core/Data/Enums/FileOperationType.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Enums +namespace Files.Core.Data.Enums { /// /// Type of operation on Files filesystem that took place @@ -54,7 +54,7 @@ public enum FileOperationType : byte CreateLink = 9, /// - /// An item is being preparend for copy/move/drag + /// An item is being prepared for copy/move/drag /// Prepare = 10, @@ -63,4 +63,4 @@ public enum FileOperationType : byte /// Compressed = 11, } -} \ No newline at end of file +} diff --git a/src/Files.Core/Data/Enums/FileSystemStatusCode.cs b/src/Files.Core/Data/Enums/FileSystemStatusCode.cs new file mode 100644 index 000000000000..65899fcadc28 --- /dev/null +++ b/src/Files.Core/Data/Enums/FileSystemStatusCode.cs @@ -0,0 +1,69 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + [Flags] + public enum FileSystemStatusCode + { + /// + /// Success + /// + Success = 0, + + /// + /// Generic + /// + Generic = 1, + + /// + /// Unauthorized + /// + Unauthorized = 2, + + /// + /// NotFound + /// + NotFound = 4, + + /// + /// InUse + /// + InUse = 8, + + /// + /// NameTooLong + /// + NameTooLong = 16, + + /// + /// AlreadyExists + /// + AlreadyExists = 32, + + /// + /// NotAFolder + /// + NotAFolder = 64, + + /// + /// NotAFile + /// + NotAFile = 128, + + /// + /// ReadOnly + /// + ReadOnly = 256, + + /// + /// PropertyLoss + /// + PropertyLoss = 512, + + /// + /// InProgress + /// + InProgress = 1024 + } +} diff --git a/src/Files.Core/Data/Enums/FilesystemOperationType.cs b/src/Files.Core/Data/Enums/FilesystemOperationType.cs new file mode 100644 index 000000000000..ae995649c9c4 --- /dev/null +++ b/src/Files.Core/Data/Enums/FilesystemOperationType.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum FilesystemOperationType + { + /// + /// Copy storage object. + /// + Copy = 0, + + /// + /// Move storage object. + /// + Move = 1, + + /// + /// Delete storage object. + /// + Delete = 2 + } +} diff --git a/src/Files.Core/Data/Enums/FolderLayoutModes.cs b/src/Files.Core/Data/Enums/FolderLayoutModes.cs new file mode 100644 index 000000000000..3ed607c2d12b --- /dev/null +++ b/src/Files.Core/Data/Enums/FolderLayoutModes.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum FolderLayoutModes + { + /// + /// Details view + /// + DetailsView = 0, + + /// + /// Tiles view + /// + TilesView = 1, + + /// + /// Column view + /// + ColumnView = 2, + + /// + /// Grid view + /// + GridView = 3, + + /// + /// Adaptive view + /// + Adaptive = 4 + } +} diff --git a/src/Files.Core/Data/Enums/GridViewSizeKind.cs b/src/Files.Core/Data/Enums/GridViewSizeKind.cs new file mode 100644 index 000000000000..7eb7297a146d --- /dev/null +++ b/src/Files.Core/Data/Enums/GridViewSizeKind.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum GridViewSizeKind + { + /// + /// Small grid view layout. + /// + Small, + + /// + /// Medium grid view layout. + /// + Medium, + + /// + /// Large grid view layout. + /// + Large + } +} diff --git a/src/Files.Shared/Enums/GroupByDateUnit.cs b/src/Files.Core/Data/Enums/GroupByDateUnit.cs similarity index 89% rename from src/Files.Shared/Enums/GroupByDateUnit.cs rename to src/Files.Core/Data/Enums/GroupByDateUnit.cs index 17d776eb0c26..26351e4159d8 100644 --- a/src/Files.Shared/Enums/GroupByDateUnit.cs +++ b/src/Files.Core/Data/Enums/GroupByDateUnit.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Enums +namespace Files.Core.Data.Enums { public enum GroupByDateUnit : byte { @@ -15,4 +15,4 @@ public enum GroupByDateUnit : byte /// Month = 1 } -} \ No newline at end of file +} diff --git a/src/Files.Core/Data/Enums/GroupOption.cs b/src/Files.Core/Data/Enums/GroupOption.cs new file mode 100644 index 000000000000..76ee7cc76e04 --- /dev/null +++ b/src/Files.Core/Data/Enums/GroupOption.cs @@ -0,0 +1,75 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum GroupOption : byte + { + /// + /// No grouping. + /// + None, + + /// + /// Group by name + /// + Name, + + /// + /// Group by date modified. + /// + DateModified, + + /// + /// Group by date created. + /// + DateCreated, + + /// + /// Group by size. + /// + Size, + + /// + /// Group by file type. + /// + FileType, + + /// + /// Group by sync status. + /// + /// + /// Preserved for cloud drives. + /// + SyncStatus, + + /// + /// Group by file tags. + /// + FileTag, + + /// + /// Group by original folder. + /// + /// + /// Preserved for recycle bin. + /// + OriginalFolder, + + /// + /// Group by date deleted. + /// + /// + /// Preserved for recycle bin. + /// + DateDeleted, + + /// + /// Group by folder path. + /// + /// + /// Preserved for libraries. + /// + FolderPath, + } +} diff --git a/src/Files.Shared/Enums/IconPersistenceOptions.cs b/src/Files.Core/Data/Enums/IconPersistenceOptions.cs similarity index 52% rename from src/Files.Shared/Enums/IconPersistenceOptions.cs rename to src/Files.Core/Data/Enums/IconPersistenceOptions.cs index ae4b392fb266..98ab7ee6e14a 100644 --- a/src/Files.Shared/Enums/IconPersistenceOptions.cs +++ b/src/Files.Core/Data/Enums/IconPersistenceOptions.cs @@ -1,11 +1,18 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Enums +namespace Files.Core.Data.Enums { public enum IconPersistenceOptions { + /// + /// Load icon once. + /// LoadOnce, + + /// + /// Persist icon loading. + /// Persist } } diff --git a/src/Files.Shared/Enums/ReturnResult.cs b/src/Files.Core/Data/Enums/ReturnResult.cs similarity index 97% rename from src/Files.Shared/Enums/ReturnResult.cs rename to src/Files.Core/Data/Enums/ReturnResult.cs index 1b9ab1307a02..8bab3adf7596 100644 --- a/src/Files.Shared/Enums/ReturnResult.cs +++ b/src/Files.Core/Data/Enums/ReturnResult.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Enums +namespace Files.Core.Data.Enums { /// /// Contains all kinds of return status @@ -53,4 +53,4 @@ public enum ReturnResult : byte /// Cancelled = 8, } -} \ No newline at end of file +} diff --git a/src/Files.Shared/Enums/SortDirection.cs b/src/Files.Core/Data/Enums/SortDirection.cs similarity index 64% rename from src/Files.Shared/Enums/SortDirection.cs rename to src/Files.Core/Data/Enums/SortDirection.cs index 898455480dd9..23d0c59efdb1 100644 --- a/src/Files.Shared/Enums/SortDirection.cs +++ b/src/Files.Core/Data/Enums/SortDirection.cs @@ -1,14 +1,21 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Enums +namespace Files.Core.Data.Enums { /// /// SortDirection is used instead of the CommunityToolkit equivalent because it is tied to the model /// public enum SortDirection : byte { + /// + /// Sort in ascending order. + /// Ascending = 0, + + /// + /// Sort in descending order. + /// Descending = 1 } -} \ No newline at end of file +} diff --git a/src/Files.Core/Data/Enums/SortOption.cs b/src/Files.Core/Data/Enums/SortOption.cs new file mode 100644 index 000000000000..43e13db15b3b --- /dev/null +++ b/src/Files.Core/Data/Enums/SortOption.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum SortOption : byte + { + /// + /// Sort by name. + /// + Name, + + /// + /// Sort by date modified. + /// + DateModified, + + /// + /// Sort by date created. + /// + DateCreated, + + /// + /// Sort by size. + /// + Size, + + /// + /// Sort by file type. + /// + FileType, + + /// + /// Sort by sync status. + /// + /// + /// Reserved for cloud drives. + /// + SyncStatus, + + /// + /// Sort by file tags. + /// + FileTag, + + /// + /// Sort by original folder. + /// + /// + /// Preserved for recycle bin. + /// + OriginalFolder, + + /// + /// Sort by date deleted. + /// + /// + /// Preserved for recycle bin. + /// + DateDeleted, + + /// + /// Sort by path. + /// + /// + /// Preserved for search results. + /// + Path + } +} diff --git a/src/Files.Core/Data/Enums/WallpaperType.cs b/src/Files.Core/Data/Enums/WallpaperType.cs new file mode 100644 index 000000000000..85358858e6e5 --- /dev/null +++ b/src/Files.Core/Data/Enums/WallpaperType.cs @@ -0,0 +1,18 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Data.Enums +{ + public enum WallpaperType + { + /// + /// Set an image to the desktop. + /// + Desktop, + + /// + /// Set an image to the lock screen. + /// + LockScreen + } +} diff --git a/src/Files.Shared/EventArguments/SettingChangedEventArgs.cs b/src/Files.Core/Data/EventArguments/SettingChangedEventArgs.cs similarity index 90% rename from src/Files.Shared/EventArguments/SettingChangedEventArgs.cs rename to src/Files.Core/Data/EventArguments/SettingChangedEventArgs.cs index 3d98afbeff53..4f28f0285d45 100644 --- a/src/Files.Shared/EventArguments/SettingChangedEventArgs.cs +++ b/src/Files.Core/Data/EventArguments/SettingChangedEventArgs.cs @@ -3,7 +3,7 @@ using System; -namespace Files.Shared.EventArguments +namespace Files.Core.Data.EventArguments { public sealed class SettingChangedEventArgs : EventArgs { diff --git a/src/Files.Shared/CompatibilityOptions.cs b/src/Files.Core/Data/Items/CompatibilityOptions.cs similarity index 98% rename from src/Files.Shared/CompatibilityOptions.cs rename to src/Files.Core/Data/Items/CompatibilityOptions.cs index bc90af284416..70525d3995e5 100644 --- a/src/Files.Shared/CompatibilityOptions.cs +++ b/src/Files.Core/Data/Items/CompatibilityOptions.cs @@ -2,10 +2,8 @@ // Licensed under the MIT License. See the LICENSE. using Files.Shared.Extensions; -using System; -using System.ComponentModel; -namespace Files.Shared +namespace Files.Core.Data.Items { public class CompatibilityOptions { @@ -30,6 +28,7 @@ public override string ToString() var value = $"~ {OSCompatibility.GetDescription()} {ReducedColorMode.GetDescription()} {HighDpiOption.GetDescription()} {HighDpiOverride.GetDescription()} " + $"{(ExecuteAt640X480 ? CompatOptions.RegExecuteAt640X480 : "")} {(DisableMaximized ? CompatOptions.RegDisableMaximized : "")} " + $"{(RunAsAdministrator ? CompatOptions.RegRunAsAdministrator : "")} {(RegisterForRestart ? CompatOptions.RegRegisterForRestart : "")}"; + return System.Text.RegularExpressions.Regex.Replace(value.Trim(), @"\s+", " "); } @@ -51,6 +50,7 @@ public static CompatibilityOptions FromString(string? rawValue) compatOptions.RegisterForRestart |= value == CompatOptions.RegRegisterForRestart; } } + return compatOptions; } diff --git a/src/Files.Shared/ContextMenu.cs b/src/Files.Core/Data/Items/ContextMenu.cs similarity index 95% rename from src/Files.Shared/ContextMenu.cs rename to src/Files.Core/Data/Items/ContextMenu.cs index 1042b916f6f4..d818b4cde2b0 100644 --- a/src/Files.Shared/ContextMenu.cs +++ b/src/Files.Core/Data/Items/ContextMenu.cs @@ -1,9 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Collections.Generic; - -namespace Files.Shared +namespace Files.Core.Data.Items { // Same definition of Vanara.PInvoke.User32.MenuItemType public enum MenuItemType : uint @@ -48,4 +46,4 @@ public class Win32ContextMenuItem public MenuItemType Type { get; set; } public List SubItems { get; set; } } -} \ No newline at end of file +} diff --git a/src/Files.Shared/DeviceEvent.cs b/src/Files.Core/Data/Items/DeviceEvent.cs similarity index 82% rename from src/Files.Shared/DeviceEvent.cs rename to src/Files.Core/Data/Items/DeviceEvent.cs index 7a5abf70bad1..e669e8913152 100644 --- a/src/Files.Shared/DeviceEvent.cs +++ b/src/Files.Core/Data/Items/DeviceEvent.cs @@ -1,13 +1,16 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared +namespace Files.Core.Data.Items { public enum DeviceEvent { Added, + Removed, + Inserted, + Ejected } -} \ No newline at end of file +} diff --git a/src/Files.Shared/FileTagsDb.cs b/src/Files.Core/Data/Items/FileTagsDb.cs similarity index 98% rename from src/Files.Shared/FileTagsDb.cs rename to src/Files.Core/Data/Items/FileTagsDb.cs index 6466e60f65d2..44ca7b738030 100644 --- a/src/Files.Shared/FileTagsDb.cs +++ b/src/Files.Core/Data/Items/FileTagsDb.cs @@ -3,26 +3,26 @@ using Files.Shared.Extensions; using LiteDB; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; using IO = System.IO; -namespace Common +namespace Files.Core.Data.Items { public class FileTagsDb : IDisposable { private readonly LiteDatabase db; + private const string TaggedFiles = "taggedfiles"; public FileTagsDb(string connection, bool shared = false) { SafetyExtensions.IgnoreExceptions(() => CheckDbVersion(connection)); + db = new LiteDatabase(new ConnectionString(connection) { Mode = shared ? LiteDB.FileMode.Shared : LiteDB.FileMode.Exclusive }); + UpdateDb(); } @@ -230,4 +230,4 @@ public class TaggedFile public string[] Tags { get; set; } = Array.Empty(); } } -} \ No newline at end of file +} diff --git a/src/Files.Shared/IconFileInfo.cs b/src/Files.Core/Data/Items/IconFileInfo.cs similarity index 89% rename from src/Files.Shared/IconFileInfo.cs rename to src/Files.Core/Data/Items/IconFileInfo.cs index 13bf830bd175..1771c29de8b8 100644 --- a/src/Files.Shared/IconFileInfo.cs +++ b/src/Files.Core/Data/Items/IconFileInfo.cs @@ -1,11 +1,12 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared +namespace Files.Core.Data.Items { public class IconFileInfo { public byte[] IconData { get; } + public int Index { get; } public IconFileInfo(byte[] iconData, int index) diff --git a/src/Files.Shared/IsExternalInit.cs b/src/Files.Core/Data/Items/IsExternalInit.cs similarity index 72% rename from src/Files.Shared/IsExternalInit.cs rename to src/Files.Core/Data/Items/IsExternalInit.cs index e9c7379d53f9..fd0d6053d45b 100644 --- a/src/Files.Shared/IsExternalInit.cs +++ b/src/Files.Core/Data/Items/IsExternalInit.cs @@ -1,10 +1,11 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.ComponentModel; namespace System.Runtime.CompilerServices { [EditorBrowsable(EditorBrowsableState.Never)] - internal sealed class IsExternalInit { } + internal sealed class IsExternalInit + { + } } diff --git a/src/Files.Shared/ShellFileItem.cs b/src/Files.Core/Data/Items/ShellFileItem.cs similarity index 77% rename from src/Files.Shared/ShellFileItem.cs rename to src/Files.Core/Data/Items/ShellFileItem.cs index c7f4e337c365..d49a2ae3424f 100644 --- a/src/Files.Shared/ShellFileItem.cs +++ b/src/Files.Core/Data/Items/ShellFileItem.cs @@ -1,24 +1,32 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System; -using System.Collections.Generic; - -namespace Files.Shared +namespace Files.Core.Data.Items { public class ShellFileItem { public bool IsFolder { get; set; } + public string RecyclePath { get; set; } + public string FileName { get; set; } + public string FilePath { get; set; } + public DateTime RecycleDate { get; set; } + public DateTime ModifiedDate { get; set; } + public DateTime CreatedDate { get; set; } + public string FileSize { get; set; } + public ulong FileSizeBytes { get; set; } + public string FileType { get; set; } + public byte[] PIDL { get; set; } // Low level shell item identifier + public Dictionary Properties { get; set; } public ShellFileItem() @@ -26,9 +34,7 @@ public ShellFileItem() Properties = new Dictionary(); } - public ShellFileItem( - bool isFolder, string recyclePath, string fileName, string filePath, - DateTime recycleDate, DateTime modifiedDate, DateTime createdDate, string fileSize, ulong fileSizeBytes, string fileType, byte[] pidl) : this() + public ShellFileItem(bool isFolder, string recyclePath, string fileName, string filePath, DateTime recycleDate, DateTime modifiedDate, DateTime createdDate, string fileSize, ulong fileSizeBytes, string fileType, byte[] pidl) : this() { IsFolder = isFolder; RecyclePath = recyclePath; @@ -43,4 +49,4 @@ public ShellFileItem( PIDL = pidl; } } -} \ No newline at end of file +} diff --git a/src/Files.Shared/ShellLibraryItem.cs b/src/Files.Core/Data/Items/ShellLibraryItem.cs similarity index 97% rename from src/Files.Shared/ShellLibraryItem.cs rename to src/Files.Core/Data/Items/ShellLibraryItem.cs index 79d08bd905f2..c1c410d76414 100644 --- a/src/Files.Shared/ShellLibraryItem.cs +++ b/src/Files.Core/Data/Items/ShellLibraryItem.cs @@ -1,10 +1,9 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System; using System.IO; -namespace Files.Shared +namespace Files.Core.Data.Items { public class ShellLibraryItem { @@ -45,11 +44,13 @@ public class ShellLibraryItem public string DisplayName { get; set; } public bool IsPinned { get; set; } + public string DefaultSaveFolder { get; set; } + public string[] Folders { get; set; } public ShellLibraryItem() { } } -} \ No newline at end of file +} diff --git a/src/Files.Shared/ShellLinkItem.cs b/src/Files.Core/Data/Items/ShellLinkItem.cs similarity index 95% rename from src/Files.Shared/ShellLinkItem.cs rename to src/Files.Core/Data/Items/ShellLinkItem.cs index 5297d1eb9d6d..459eef67bd56 100644 --- a/src/Files.Shared/ShellLinkItem.cs +++ b/src/Files.Core/Data/Items/ShellLinkItem.cs @@ -1,14 +1,18 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared +namespace Files.Core.Data.Items { public class ShellLinkItem : ShellFileItem { public string TargetPath { get; set; } + public string Arguments { get; set; } + public string WorkingDirectory { get; set; } + public bool RunAsAdmin { get; set; } + public bool InvalidTarget { get; set; } public ShellLinkItem() diff --git a/src/Files.Shared/ShellNewEntry.cs b/src/Files.Core/Data/Items/ShellNewEntry.cs similarity index 90% rename from src/Files.Shared/ShellNewEntry.cs rename to src/Files.Core/Data/Items/ShellNewEntry.cs index db32792a3d19..6b0e919bb38d 100644 --- a/src/Files.Shared/ShellNewEntry.cs +++ b/src/Files.Core/Data/Items/ShellNewEntry.cs @@ -1,15 +1,20 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared +namespace Files.Core.Data.Items { public class ShellNewEntry { public string Extension { get; set; } + public string Name { get; set; } + public string Command { get; set; } + public string IconBase64 { get; set; } + public byte[] Data { get; set; } + public string Template { get; set; } } } diff --git a/src/Files.Shared/ShellOperationResult.cs b/src/Files.Core/Data/Items/ShellOperationResult.cs similarity index 93% rename from src/Files.Shared/ShellOperationResult.cs rename to src/Files.Core/Data/Items/ShellOperationResult.cs index 88bea5680831..fd8dcb3aaee1 100644 --- a/src/Files.Shared/ShellOperationResult.cs +++ b/src/Files.Core/Data/Items/ShellOperationResult.cs @@ -1,10 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Collections.Generic; -using System.Linq; - -namespace Files.Shared +namespace Files.Core.Data.Items { public class ShellOperationResult { diff --git a/src/Files.Shared/Win32Process.cs b/src/Files.Core/Data/Items/Win32Process.cs similarity index 88% rename from src/Files.Shared/Win32Process.cs rename to src/Files.Core/Data/Items/Win32Process.cs index d05bfe2e5ab0..99ceee3cc9f1 100644 --- a/src/Files.Shared/Win32Process.cs +++ b/src/Files.Core/Data/Items/Win32Process.cs @@ -1,13 +1,16 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared +namespace Files.Core.Data.Items { public class Win32Process { public string Name { get; set; } + public int Pid { get; set; } + public string FileName { get; set; } + public string AppName { get; set; } } } diff --git a/src/Files.Shared/Extensions/GroupOptionExtensions.cs b/src/Files.Core/Extensions/GroupOptionExtensions.cs similarity index 83% rename from src/Files.Shared/Extensions/GroupOptionExtensions.cs rename to src/Files.Core/Extensions/GroupOptionExtensions.cs index 3f537a3a31f1..d0413290de07 100644 --- a/src/Files.Shared/Extensions/GroupOptionExtensions.cs +++ b/src/Files.Core/Extensions/GroupOptionExtensions.cs @@ -1,9 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; - -namespace Files.Shared.Extensions +namespace Files.Core.Extensions { public static class GroupOptionExtensions { diff --git a/src/Files.Shared/Extensions/Win32Extensions.cs b/src/Files.Core/Extensions/Win32Extensions.cs similarity index 84% rename from src/Files.Shared/Extensions/Win32Extensions.cs rename to src/Files.Core/Extensions/Win32Extensions.cs index ee715e4cf36e..46b799576cba 100644 --- a/src/Files.Shared/Extensions/Win32Extensions.cs +++ b/src/Files.Core/Extensions/Win32Extensions.cs @@ -1,9 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System; - -namespace Files.Shared.Extensions +namespace Files.Core.Extensions { public static class Win32Extensions { diff --git a/src/Files.Core/GlobalUsings.cs b/src/Files.Core/GlobalUsings.cs index efcf3a0180a1..0393d56a980a 100644 --- a/src/Files.Core/GlobalUsings.cs +++ b/src/Files.Core/GlobalUsings.cs @@ -20,8 +20,9 @@ global using global::CommunityToolkit.Mvvm.Messaging; // Files Back-end -global using global::Files.Core.CommandLine; global using global::Files.Core.Data.Enums; +global using global::Files.Core.Data.EventArguments; +global using global::Files.Core.Data.Items; global using global::Files.Core.Data.Messages; global using global::Files.Core.Data.Models; global using global::Files.Core.Extensions; @@ -30,3 +31,5 @@ global using global::Files.Core.Services.Settings; global using global::Files.Core.Services.SizeProvider; global using global::Files.Core.ViewModels; +global using global::Files.Core.Utils; +global using global::Files.Core.Utils.CommandLine; diff --git a/src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatter.cs b/src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatter.cs similarity index 78% rename from src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatter.cs rename to src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatter.cs index f61fd4bc32f8..1f0ef371467e 100644 --- a/src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatter.cs +++ b/src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatter.cs @@ -1,10 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; -using System; - -namespace Files.Shared.Services.DateTimeFormatter +namespace Files.Core.Services.DateTimeFormatter { public interface IDateTimeFormatter { diff --git a/src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs b/src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs similarity index 74% rename from src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs rename to src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs index 4d12e1a32598..042f0bf5c3c6 100644 --- a/src/Files.Shared/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs +++ b/src/Files.Core/Services/DateTimeFormatter/IDateTimeFormatterFactory.cs @@ -1,9 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; - -namespace Files.Shared.Services.DateTimeFormatter +namespace Files.Core.Services.DateTimeFormatter { public interface IDateTimeFormatterFactory { diff --git a/src/Files.Shared/Services/DateTimeFormatter/ITimeSpanLabel.cs b/src/Files.Core/Services/DateTimeFormatter/ITimeSpanLabel.cs similarity index 80% rename from src/Files.Shared/Services/DateTimeFormatter/ITimeSpanLabel.cs rename to src/Files.Core/Services/DateTimeFormatter/ITimeSpanLabel.cs index 6672a9c2273b..42c7d214c3a2 100644 --- a/src/Files.Shared/Services/DateTimeFormatter/ITimeSpanLabel.cs +++ b/src/Files.Core/Services/DateTimeFormatter/ITimeSpanLabel.cs @@ -1,12 +1,14 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Services.DateTimeFormatter +namespace Files.Core.Services.DateTimeFormatter { public interface ITimeSpanLabel { string Text { get; } + string Glyph { get; } + int Index { get; } } } diff --git a/src/Files.Core/Services/IAddItemService.cs b/src/Files.Core/Services/IAddItemService.cs index 30535dd05824..3fc24ad6d89c 100644 --- a/src/Files.Core/Services/IAddItemService.cs +++ b/src/Files.Core/Services/IAddItemService.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared; - namespace Files.Core.Services { /// diff --git a/src/Files.Core/Services/IDialogService.cs b/src/Files.Core/Services/IDialogService.cs index 2ea9fa7d09aa..b450d8be1b72 100644 --- a/src/Files.Core/Services/IDialogService.cs +++ b/src/Files.Core/Services/IDialogService.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See the LICENSE. using Files.Core.ViewModels.Dialogs; -using Files.Shared.Enums; +using Files.Core.Data.Enums; namespace Files.Core.Services { diff --git a/src/Files.Shared/Services/IJumpListService.cs b/src/Files.Core/Services/IJumpListService.cs similarity index 75% rename from src/Files.Shared/Services/IJumpListService.cs rename to src/Files.Core/Services/IJumpListService.cs index eac7ee5d050c..771980258d82 100644 --- a/src/Files.Shared/Services/IJumpListService.cs +++ b/src/Files.Core/Services/IJumpListService.cs @@ -1,16 +1,16 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Files.Shared.Services +namespace Files.Core.Services { public interface IJumpListService { Task AddFolderAsync(string path); + Task RefreshPinnedFoldersAsync(); + Task RemoveFolderAsync(string path); + Task> GetFoldersAsync(); } -} \ No newline at end of file +} diff --git a/src/Files.Core/Services/IQuickAccessService.cs b/src/Files.Core/Services/IQuickAccessService.cs index 19519cb91668..f9b6c173d72f 100644 --- a/src/Files.Core/Services/IQuickAccessService.cs +++ b/src/Files.Core/Services/IQuickAccessService.cs @@ -1,8 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared; - namespace Files.App.Services { public interface IQuickAccessService diff --git a/src/Files.Core/Services/Settings/IFoldersSettingsService.cs b/src/Files.Core/Services/Settings/IFoldersSettingsService.cs index 2825db155c43..4fabe666c4c7 100644 --- a/src/Files.Core/Services/Settings/IFoldersSettingsService.cs +++ b/src/Files.Core/Services/Settings/IFoldersSettingsService.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; using System.ComponentModel; namespace Files.Core.Services.Settings diff --git a/src/Files.Core/Services/Settings/IGeneralSettingsService.cs b/src/Files.Core/Services/Settings/IGeneralSettingsService.cs index 14d08623fc7b..b50c38436fa3 100644 --- a/src/Files.Core/Services/Settings/IGeneralSettingsService.cs +++ b/src/Files.Core/Services/Settings/IGeneralSettingsService.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; using System.Collections.Generic; using System.ComponentModel; diff --git a/src/Files.Core/Services/Settings/IUserSettingsService.cs b/src/Files.Core/Services/Settings/IUserSettingsService.cs index b0b4c3ae70dd..9a80b806c613 100644 --- a/src/Files.Core/Services/Settings/IUserSettingsService.cs +++ b/src/Files.Core/Services/Settings/IUserSettingsService.cs @@ -1,9 +1,6 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.EventArguments; -using System; - namespace Files.Core.Services.Settings { public interface IUserSettingsService : IBaseSettingsService diff --git a/src/Files.Shared/Cloud/CloudDriveSyncStatus.cs b/src/Files.Core/Utils/Cloud/CloudDriveSyncStatus.cs similarity index 89% rename from src/Files.Shared/Cloud/CloudDriveSyncStatus.cs rename to src/Files.Core/Utils/Cloud/CloudDriveSyncStatus.cs index 7ad842cd529f..4be9fef50ebf 100644 --- a/src/Files.Shared/Cloud/CloudDriveSyncStatus.cs +++ b/src/Files.Core/Utils/Cloud/CloudDriveSyncStatus.cs @@ -1,21 +1,32 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Cloud +namespace Files.Core.Utils.Cloud { public enum CloudDriveSyncStatus { Unknown = -1, + FolderOnline = 0, + FolderOfflinePartial = 1, + FolderOfflineFull = 2, + FolderOfflinePinned = 3, + FolderExcluded = 4, + FolderEmpty = 5, + NotSynced = 6, + FileOnline = 8, + FileSync = 9, + FileOffline = 14, + FileOfflinePinned = 15, } -} \ No newline at end of file +} diff --git a/src/Files.Core/Utils/Cloud/CloudProvider.cs b/src/Files.Core/Utils/Cloud/CloudProvider.cs new file mode 100644 index 000000000000..3e9964299e83 --- /dev/null +++ b/src/Files.Core/Utils/Cloud/CloudProvider.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.Core.Utils.Cloud +{ + public class CloudProvider : ICloudProvider + { + public CloudProviders ID { get; } + + public string Name { get; init; } = string.Empty; + + public string SyncFolder { get; init; } = string.Empty; + + public byte[]? IconData { get; init; } + + public CloudProvider(CloudProviders id) + { + ID = id; + } + + public override int GetHashCode() + { + return (ID, SyncFolder).GetHashCode(); + } + + public override bool Equals(object? o) + { + return o is ICloudProvider other && Equals(other); + } + + public bool Equals(ICloudProvider? other) + { + return other is not null && other.ID == ID && other.SyncFolder == SyncFolder; + } + } +} diff --git a/src/Files.Shared/Cloud/CloudProviders.cs b/src/Files.Core/Utils/Cloud/CloudProviders.cs similarity index 88% rename from src/Files.Shared/Cloud/CloudProviders.cs rename to src/Files.Core/Utils/Cloud/CloudProviders.cs index 257e6c94fcf3..9b47b9d47e26 100644 --- a/src/Files.Shared/Cloud/CloudProviders.cs +++ b/src/Files.Core/Utils/Cloud/CloudProviders.cs @@ -1,28 +1,46 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Shared.Cloud +namespace Files.Core.Utils.Cloud { public enum CloudProviders { OneDrive, + OneDriveCommercial, + Mega, + GoogleDrive, + DropBox, + AppleCloudDrive, + AppleCloudPhotos, + AmazonDrive, + Nextcloud, + Yandex, + Box, + Jottacloud, + SynologyDrive, + pCloud, + AdobeCreativeCloud, + Nutstore, + Seadrive, + Autodesk, + ownCloud, } -} \ No newline at end of file +} diff --git a/src/Files.Shared/Cloud/ICloudDetector.cs b/src/Files.Core/Utils/Cloud/ICloudDetector.cs similarity index 67% rename from src/Files.Shared/Cloud/ICloudDetector.cs rename to src/Files.Core/Utils/Cloud/ICloudDetector.cs index 2205117866f6..f7bde568816a 100644 --- a/src/Files.Shared/Cloud/ICloudDetector.cs +++ b/src/Files.Core/Utils/Cloud/ICloudDetector.cs @@ -1,13 +1,10 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Files.Shared.Cloud +namespace Files.Core.Utils.Cloud { public interface ICloudDetector { Task> DetectCloudProvidersAsync(); } -} \ No newline at end of file +} diff --git a/src/Files.Shared/Cloud/ICloudProvider.cs b/src/Files.Core/Utils/Cloud/ICloudProvider.cs similarity index 87% rename from src/Files.Shared/Cloud/ICloudProvider.cs rename to src/Files.Core/Utils/Cloud/ICloudProvider.cs index bf8031ce70aa..4ee1d9181624 100644 --- a/src/Files.Shared/Cloud/ICloudProvider.cs +++ b/src/Files.Core/Utils/Cloud/ICloudProvider.cs @@ -1,16 +1,16 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System; - -namespace Files.Shared.Cloud +namespace Files.Core.Utils.Cloud { public interface ICloudProvider : IEquatable { public CloudProviders ID { get; } public string Name { get; } + public string SyncFolder { get; } + public byte[]? IconData { get; } } -} \ No newline at end of file +} diff --git a/src/Files.Core/CommandLine/CommandLineParser.cs b/src/Files.Core/Utils/CommandLine/CommandLineParser.cs similarity index 99% rename from src/Files.Core/CommandLine/CommandLineParser.cs rename to src/Files.Core/Utils/CommandLine/CommandLineParser.cs index 26341273e5f8..b47406d0a9d0 100644 --- a/src/Files.Core/CommandLine/CommandLineParser.cs +++ b/src/Files.Core/Utils/CommandLine/CommandLineParser.cs @@ -3,7 +3,7 @@ using System.IO; -namespace Files.Core.CommandLine +namespace Files.Core.Utils.CommandLine { /// /// Provides static helper for parsing of command line arguments on Windows. diff --git a/src/Files.Core/CommandLine/ParsedCommand.cs b/src/Files.Core/Utils/CommandLine/ParsedCommand.cs similarity index 94% rename from src/Files.Core/CommandLine/ParsedCommand.cs rename to src/Files.Core/Utils/CommandLine/ParsedCommand.cs index 8607a5aee7b3..a5ae4b8c4823 100644 --- a/src/Files.Core/CommandLine/ParsedCommand.cs +++ b/src/Files.Core/Utils/CommandLine/ParsedCommand.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Core.CommandLine +namespace Files.Core.Utils.CommandLine { /// /// Represents a parsed command node on Windows. diff --git a/src/Files.Core/CommandLine/ParsedCommands.cs b/src/Files.Core/Utils/CommandLine/ParsedCommands.cs similarity index 85% rename from src/Files.Core/CommandLine/ParsedCommands.cs rename to src/Files.Core/Utils/CommandLine/ParsedCommands.cs index e14d7b2ed2cd..f8c18df0c8e0 100644 --- a/src/Files.Core/CommandLine/ParsedCommands.cs +++ b/src/Files.Core/Utils/CommandLine/ParsedCommands.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -namespace Files.Core.CommandLine +namespace Files.Core.Utils.CommandLine { /// /// Represents a collection of parsed command. diff --git a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs index f21ca7c738d4..7ab160f9afff 100644 --- a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs +++ b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; using System.IO; namespace Files.Core.ViewModels.Dialogs.FileSystemDialog diff --git a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs index 7727a2665ead..caa78061b2f6 100644 --- a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs +++ b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; using Files.Shared.Extensions; namespace Files.Core.ViewModels.Dialogs.FileSystemDialog diff --git a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/IFileSystemDialogConflictItemViewModel.cs b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/IFileSystemDialogConflictItemViewModel.cs index a483f61793c9..e49ef093e208 100644 --- a/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/IFileSystemDialogConflictItemViewModel.cs +++ b/src/Files.Core/ViewModels/Dialogs/FileSystemDialog/IFileSystemDialogConflictItemViewModel.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; namespace Files.Core.ViewModels.Dialogs.FileSystemDialog { diff --git a/src/Files.Core/ViewModels/Dialogs/IDialog.cs b/src/Files.Core/ViewModels/Dialogs/IDialog.cs index 48d327f492e8..dfa5d505fb47 100644 --- a/src/Files.Core/ViewModels/Dialogs/IDialog.cs +++ b/src/Files.Core/ViewModels/Dialogs/IDialog.cs @@ -1,7 +1,7 @@ // Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.Shared.Enums; +using Files.Core.Data.Enums; namespace Files.Core.ViewModels.Dialogs { diff --git a/src/Files.Shared/Cloud/CloudProvider.cs b/src/Files.Shared/Cloud/CloudProvider.cs deleted file mode 100644 index 92ecc5d2ccc1..000000000000 --- a/src/Files.Shared/Cloud/CloudProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Cloud -{ - public class CloudProvider : ICloudProvider - { - public CloudProviders ID { get; } - - public string Name { get; init; } = string.Empty; - public string SyncFolder { get; init; } = string.Empty; - public byte[]? IconData { get; init; } - - public CloudProvider(CloudProviders id) => ID = id; - - public override int GetHashCode() => (ID, SyncFolder).GetHashCode(); - public override bool Equals(object? o) => o is ICloudProvider other && Equals(other); - public bool Equals(ICloudProvider? other) => other is not null && other.ID == ID && other.SyncFolder == SyncFolder; - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/DateTimeFormats.cs b/src/Files.Shared/Enums/DateTimeFormats.cs deleted file mode 100644 index 3cd2b1cc0478..000000000000 --- a/src/Files.Shared/Enums/DateTimeFormats.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum DateTimeFormats - { - Application = 0, - System = 1, - Universal = 2, - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/DeleteConfirmationPolicy.cs b/src/Files.Shared/Enums/DeleteConfirmationPolicy.cs deleted file mode 100644 index 23ddfd4ee26d..000000000000 --- a/src/Files.Shared/Enums/DeleteConfirmationPolicy.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum DeleteConfirmationPolicies : byte - { - Always, - PermanentOnly, - Never, - } -} diff --git a/src/Files.Shared/Enums/DialogResult.cs b/src/Files.Shared/Enums/DialogResult.cs deleted file mode 100644 index c2bd67c58644..000000000000 --- a/src/Files.Shared/Enums/DialogResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum DialogResult - { - None = 0, - Primary = 1, - Secondary = 2 - } -} diff --git a/src/Files.Shared/Enums/DynamicDialogButtons.cs b/src/Files.Shared/Enums/DynamicDialogButtons.cs deleted file mode 100644 index 3153214d0057..000000000000 --- a/src/Files.Shared/Enums/DynamicDialogButtons.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum DynamicDialogButtons - { - Primary = 1, - Secondary = 2, - Cancel = 4, - None = 8 - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/DynamicDialogResult.cs b/src/Files.Shared/Enums/DynamicDialogResult.cs deleted file mode 100644 index 2f832ab55937..000000000000 --- a/src/Files.Shared/Enums/DynamicDialogResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum DynamicDialogResult - { - Primary = 1, - Secondary = 2, - Cancel = 4, - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/FileNameConflictResolveOptionType.cs b/src/Files.Shared/Enums/FileNameConflictResolveOptionType.cs deleted file mode 100644 index c1725215bb49..000000000000 --- a/src/Files.Shared/Enums/FileNameConflictResolveOptionType.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum FileNameConflictResolveOptionType : uint - { - GenerateNewName = 0, - ReplaceExisting = 1, - Skip = 2, - None = 4 - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/FileSystemStatusCode.cs b/src/Files.Shared/Enums/FileSystemStatusCode.cs deleted file mode 100644 index f452653ca323..000000000000 --- a/src/Files.Shared/Enums/FileSystemStatusCode.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -using System; - -namespace Files.Shared.Enums -{ - [Flags] - public enum FileSystemStatusCode - { - Success = 0, - Generic = 1, - Unauthorized = 2, - NotFound = 4, - InUse = 8, - NameTooLong = 16, - AlreadyExists = 32, - NotAFolder = 64, - NotAFile = 128, - ReadOnly = 256, - PropertyLoss = 512, - InProgress = 1024 - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/FilesystemOperationType.cs b/src/Files.Shared/Enums/FilesystemOperationType.cs deleted file mode 100644 index e087add1f49d..000000000000 --- a/src/Files.Shared/Enums/FilesystemOperationType.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum FilesystemOperationType - { - Copy = 0, - Move = 1, - Delete = 2 - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/FolderLayoutModes.cs b/src/Files.Shared/Enums/FolderLayoutModes.cs deleted file mode 100644 index 4e71cbc4073f..000000000000 --- a/src/Files.Shared/Enums/FolderLayoutModes.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum FolderLayoutModes - { - DetailsView = 0, - TilesView = 1, - ColumnView = 2, - GridView = 3, - Adaptive = 4 - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/GridViewSizeKind.cs b/src/Files.Shared/Enums/GridViewSizeKind.cs deleted file mode 100644 index ce79a8151b64..000000000000 --- a/src/Files.Shared/Enums/GridViewSizeKind.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum GridViewSizeKind - { - Small, - Medium, - Large - } -} diff --git a/src/Files.Shared/Enums/GroupOption.cs b/src/Files.Shared/Enums/GroupOption.cs deleted file mode 100644 index 52c4f1934c87..000000000000 --- a/src/Files.Shared/Enums/GroupOption.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum GroupOption : byte - { - None, - Name, - DateModified, - DateCreated, - Size, - FileType, - SyncStatus, // Cloud drive - FileTag, - OriginalFolder, // Recycle bin - DateDeleted, // Recycle bin - FolderPath, // Libraries - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/SortOption.cs b/src/Files.Shared/Enums/SortOption.cs deleted file mode 100644 index 08c4e3e9879b..000000000000 --- a/src/Files.Shared/Enums/SortOption.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum SortOption : byte - { - Name, - DateModified, - DateCreated, - Size, - FileType, - SyncStatus, // Cloud drive - FileTag, - OriginalFolder, // Recycle bin - DateDeleted, // Recycle bin - Path // Search results - } -} \ No newline at end of file diff --git a/src/Files.Shared/Enums/WallpaperType.cs b/src/Files.Shared/Enums/WallpaperType.cs deleted file mode 100644 index cfc5d4e2576b..000000000000 --- a/src/Files.Shared/Enums/WallpaperType.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2023 Files Community -// Licensed under the MIT License. See the LICENSE. - -namespace Files.Shared.Enums -{ - public enum WallpaperType - { - Desktop, - LockScreen - } -} \ No newline at end of file diff --git a/src/Files.Shared/Extensions/DateExtensions.cs b/src/Files.Shared/Extensions/DateExtensions.cs index 145b2855335a..7ea8e15fd388 100644 --- a/src/Files.Shared/Extensions/DateExtensions.cs +++ b/src/Files.Shared/Extensions/DateExtensions.cs @@ -13,6 +13,7 @@ public static DateTime ToDateTime(this FILETIME time) uint low = (uint)time.dwLowDateTime; ulong high = (ulong)time.dwHighDateTime; long fileTime = (long)((high << 32) + low); + try { return DateTime.FromFileTimeUtc(fileTime); diff --git a/src/Files.Shared/Extensions/EnumerableExtensions.cs b/src/Files.Shared/Extensions/EnumerableExtensions.cs index 139a8282f646..8e7961c16cb7 100644 --- a/src/Files.Shared/Extensions/EnumerableExtensions.cs +++ b/src/Files.Shared/Extensions/EnumerableExtensions.cs @@ -18,27 +18,28 @@ public static class EnumerableExtensions /// The item type /// The item /// with - public static IEnumerable CreateEnumerable(this T item) => - new[] { item }; + public static IEnumerable CreateEnumerable(this T item) + { + return new[] { item }; + } - public static List CreateList(this T item) => - new() { item }; + public static List CreateList(this T item) + { + return new() { item }; + } public static IList AddIfNotPresent(this IList list, T element) { if (!list.Contains(element)) - { list.Add(element); - } + return list; } public static ICollection EnumeratedAdd(this ICollection collection, IEnumerable source) { foreach (var item in source) - { collection.Add(item); - } return collection; } @@ -46,9 +47,8 @@ public static ICollection EnumeratedAdd(this ICollection collection, IE public static IDictionary AddIfNotPresent(this IDictionary dictionary, TKey key, TValue value) { if (!dictionary.ContainsKey(key)) - { dictionary.Add(key, value); - } + return dictionary; } @@ -72,16 +72,12 @@ public static async Task ParallelForEachAsync(this IEnumerable source, Fun }; if (scheduler is not null) - { options.TaskScheduler = scheduler; - } var block = new ActionBlock(body, options); foreach (var item in source) - { block.Post(item); - } block.Complete(); @@ -89,20 +85,19 @@ public static async Task ParallelForEachAsync(this IEnumerable source, Fun } public static Task> ToListAsync(this IEnumerable source) - => Task.Run(() => (IList)source.ToList()); + { + return Task.Run(() => (IList)source.ToList()); + } - public static IEnumerable Zip( - this IEnumerable source, - IEnumerable second, - Func func) + public static IEnumerable Zip(this IEnumerable source, IEnumerable second, Func func) { - using (var e1 = source.GetEnumerator()) - using (var e2 = second.GetEnumerator()) - { - var index = 0; - while (e1.MoveNext() && e2.MoveNext()) - yield return func(e1.Current, e2.Current, index++); - } + using var e1 = source.GetEnumerator(); + using var e2 = second.GetEnumerator(); + + var index = 0; + + while (e1.MoveNext() && e2.MoveNext()) + yield return func(e1.Current, e2.Current, index++); } } } diff --git a/src/Files.Shared/Extensions/FileLoggerExtensions.cs b/src/Files.Shared/Extensions/FileLoggerExtensions.cs index 8fc2175b1140..cece94736a3f 100644 --- a/src/Files.Shared/Extensions/FileLoggerExtensions.cs +++ b/src/Files.Shared/Extensions/FileLoggerExtensions.cs @@ -10,6 +10,7 @@ public static class FileLoggerExtensions public static ILoggerFactory AddFile(this ILoggerFactory factory, string filePath) { factory.AddProvider(new FileLoggerProvider(filePath)); + return factory; } } diff --git a/src/Files.Shared/Extensions/LinqExtensions.cs b/src/Files.Shared/Extensions/LinqExtensions.cs index 03ede19a8aef..858b8b04e0d5 100644 --- a/src/Files.Shared/Extensions/LinqExtensions.cs +++ b/src/Files.Shared/Extensions/LinqExtensions.cs @@ -23,7 +23,10 @@ public static class LinqExtensions /// /// /// - public static bool IsEmpty(this IEnumerable enumerable) => enumerable is null || !enumerable.Any(); + public static bool IsEmpty(this IEnumerable enumerable) + { + return enumerable is null || !enumerable.Any(); + } public static TOut? Get(this IDictionary dictionary, TKey key, TOut? defaultValue = default) where TKey : notnull { @@ -97,12 +100,14 @@ public static class LinqExtensions public static async Task> WhereAsync(this IEnumerable source, Func> predicate) { var results = await Task.WhenAll(source.Select(async x => (x, await predicate(x)))); + return results.Where(x => x.Item2).Select(x => x.x); } public static IEnumerable ExceptBy(this IEnumerable source, IEnumerable other, Func keySelector) { var set = new HashSet(other.Select(keySelector)); + foreach (var item in source) { if (set.Add(keySelector(item))) @@ -111,7 +116,9 @@ public static IEnumerable ExceptBy(this IEnumerable IntersectBy(this IEnumerable items, IEnumerable others, Func keySelector) - => items.Join(others.Select(keySelector), keySelector, id => id, (o, id) => o); + { + return items.Join(others.Select(keySelector), keySelector, id => id, (o, id) => o); + } /// /// Enumerates through of elements and executes @@ -130,12 +137,14 @@ public static int AddSorted(this IList list, T item) where T : IComparable if (!list.Any() || list.Last().CompareTo(item) <= 0) { list.Add(item); + return list.Count; } if (list[0].CompareTo(item) >= 0) { list.Insert(0, item); + return 0; } @@ -144,6 +153,7 @@ public static int AddSorted(this IList list, T item) where T : IComparable index = ~index; list.Insert(index, item); + return index; } diff --git a/src/Files.Shared/Extensions/SafetyExtensions.cs b/src/Files.Shared/Extensions/SafetyExtensions.cs index a7e06c8b4419..bac212488628 100644 --- a/src/Files.Shared/Extensions/SafetyExtensions.cs +++ b/src/Files.Shared/Extensions/SafetyExtensions.cs @@ -19,6 +19,7 @@ public static bool IgnoreExceptions(Action action, ILogger? logger = null) catch (Exception ex) { logger?.LogInformation(ex, ex.Message); + return false; } } @@ -28,11 +29,13 @@ public static async Task IgnoreExceptions(Func action, ILogger? logg try { await action(); + return true; } catch (Exception ex) { logger?.LogInformation(ex, ex.Message); + return false; } } @@ -46,6 +49,7 @@ public static async Task IgnoreExceptions(Func action, ILogger? logg catch (Exception ex) { logger?.LogInformation(ex, ex.Message); + return default; } } @@ -59,6 +63,7 @@ public static async Task IgnoreExceptions(Func action, ILogger? logg catch (Exception ex) { logger?.LogInformation(ex, ex.Message); + return default; } } diff --git a/src/Files.Shared/Extensions/TaskExtensions.cs b/src/Files.Shared/Extensions/TaskExtensions.cs index 9780b39970af..0ba31a8878c4 100644 --- a/src/Files.Shared/Extensions/TaskExtensions.cs +++ b/src/Files.Shared/Extensions/TaskExtensions.cs @@ -19,15 +19,15 @@ public static async Task WithTimeoutAsync(this Task task, TimeSpan timeout) public static async Task WithTimeoutAsync(this Task task, TimeSpan timeout, T? defaultValue = default) { if (task == await Task.WhenAny(task, Task.Delay(timeout))) - { return await task; - } + return defaultValue; } public static async Task AndThen(this Task inputTask, Func> mapping) { var input = await inputTask; + return (await mapping(input)); } } diff --git a/src/Files.Shared/Files.Shared.csproj b/src/Files.Shared/Files.Shared.csproj index fd6ac108eb99..fd48d956fdab 100644 --- a/src/Files.Shared/Files.Shared.csproj +++ b/src/Files.Shared/Files.Shared.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Files.Shared/Helpers/ChecksumHelpers.cs b/src/Files.Shared/Helpers/ChecksumHelpers.cs index 1c4952624b42..2ea843fb344f 100644 --- a/src/Files.Shared/Helpers/ChecksumHelpers.cs +++ b/src/Files.Shared/Helpers/ChecksumHelpers.cs @@ -18,6 +18,7 @@ public static string CalculateChecksumForPath(string path) var buffer = Encoding.UTF8.GetBytes(path); Span hash = stackalloc byte[MD5.HashSizeInBytes]; MD5.HashData(buffer, hash); + return Convert.ToHexString(hash); } diff --git a/src/Files.Shared/Helpers/PathHelpers.cs b/src/Files.Shared/Helpers/PathHelpers.cs index cd3befc27967..d23d5c837ef3 100644 --- a/src/Files.Shared/Helpers/PathHelpers.cs +++ b/src/Files.Shared/Helpers/PathHelpers.cs @@ -11,6 +11,7 @@ public static string Combine(string folder, string name) { if (string.IsNullOrEmpty(folder)) return name; + return folder.Contains('/') ? Path.Combine(folder, name).Replace('\\', '/') : Path.Combine(folder, name); } } diff --git a/src/Files.Shared/FileLogger.cs b/src/Files.Shared/Utils/Logger/FileLogger.cs similarity index 94% rename from src/Files.Shared/FileLogger.cs rename to src/Files.Shared/Utils/Logger/FileLogger.cs index f993b06279c5..cdbab4f339c1 100644 --- a/src/Files.Shared/FileLogger.cs +++ b/src/Files.Shared/Utils/Logger/FileLogger.cs @@ -24,16 +24,21 @@ public FileLogger(string filePath) return null; } - public bool IsEnabled(LogLevel logLevel) => true; + public bool IsEnabled(LogLevel logLevel) + { + return true; + } public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) { if (formatter is not null) { semaphoreSlim.Wait(); + try { var message = exception?.ToString() ?? formatter(state, exception); + File.AppendAllText(filePath, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.ffff}|{logLevel}|{message}" + Environment.NewLine); } catch (Exception e) diff --git a/src/Files.Shared/FileLoggerProvider.cs b/src/Files.Shared/Utils/Logger/FileLoggerProvider.cs similarity index 79% rename from src/Files.Shared/FileLoggerProvider.cs rename to src/Files.Shared/Utils/Logger/FileLoggerProvider.cs index 6e8113a92476..94ba152bec9b 100644 --- a/src/Files.Shared/FileLoggerProvider.cs +++ b/src/Files.Shared/Utils/Logger/FileLoggerProvider.cs @@ -2,11 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Files.Shared {