Skip to content

Code Quality: Reorganize App.Services namespace #15473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Files.App.Storage/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

global using global::Files.Core.Storage;
global using global::Files.Core.Storage.Contracts;
global using global::Files.Core.Storage.DirectStorage;
global using global::Files.Core.Storage.Storables;
global using global::Files.Core.Storage.Enums;
global using global::Files.Core.Storage.EventArguments;
global using global::Files.Core.Storage.ExtendableStorage;
global using global::Files.Core.Storage.Extensions;
global using global::Files.Core.Storage.LocatableStorage;
global using global::Files.Core.Storage.ModifiableStorage;
global using global::Files.Core.Storage.MutableStorage;
global using global::Files.Core.Storage.NestedStorage;
global using global::Files.Core.Storage.StorageEnumeration;

// Files.App.Storage

global using global::Files.App.Storage;
global using global::Files.App.Storage.Storables;
2 changes: 1 addition & 1 deletion src/Files.App.Storage/Storables/FtpStorage/FtpHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Files.Shared.Extensions;
using FluentFTP;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
internal static class FtpHelpers
{
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App.Storage/Storables/FtpStorage/FtpManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Net;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
public static class FtpManager
{
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App.Storage/Storables/FtpStorage/FtpStorable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using FluentFTP;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
public abstract class FtpStorable : ILocatableStorable, INestedStorable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.IO;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
public sealed class FtpStorageFile : FtpStorable, IModifiableFile, ILocatableFile, INestedFile
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.IO;
using System.Runtime.CompilerServices;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
public sealed class FtpStorageFolder : FtpStorable, ILocatableFolder, IModifiableFolder, IFolderExtended, INestedFolder, IDirectCopy, IDirectMove
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using FluentFTP;
using System.IO;

namespace Files.App.Storage.FtpStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IFtpStorageService"/>
public sealed class FtpStorageService : IFtpStorageService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.IO;

namespace Files.App.Storage.NativeStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IFile"/>
public class NativeFile : NativeStorable<FileInfo>, ILocatableFile, IModifiableFile, IFileExtended, INestedFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Runtime.CompilerServices;

namespace Files.App.Storage.NativeStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IFolder"/>
public class NativeFolder : NativeStorable<DirectoryInfo>, ILocatableFolder, IModifiableFolder, IMutableFolder, IFolderExtended, INestedFolder, IDirectCopy, IDirectMove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.IO;

namespace Files.App.Storage.NativeStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IStorable"/>
public abstract class NativeStorable<TStorage> : ILocatableStorable, INestedStorable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using Windows.Storage;

namespace Files.App.Storage.NativeStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IStorageService"/>
public sealed class NativeStorageService : IStorageService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Files.Shared.Helpers;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IStorable"/>
public abstract class WindowsStorable<TStorage> : ILocatableStorable, INestedStorable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IFile"/>
public sealed class WindowsStorageFile : WindowsStorable<StorageFile>, ILocatableFile, IModifiableFile, IFileExtended, INestedFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Runtime.CompilerServices;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IFolder"/>
public sealed class WindowsStorageFolder : WindowsStorable<StorageFolder>, ILocatableFolder, IFolderExtended, INestedFolder, IDirectCopy, IDirectMove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
namespace Files.App.Storage.Storables
{
/// <inheritdoc cref="IStorageService"/>
internal sealed class WindowsStorageService : IStorageService
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/AppModels/SingleFileDatabaseModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Files.Core.Storage;
using Files.Core.Storage.Extensions;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.Storables;
using Files.Shared.Extensions;
using Files.Shared.Utils;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
internal interface IActionsSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IAppSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IApplicationSettingsService : IBaseSettingsService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IBaseSettingsService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IDevToolsSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
28 changes: 0 additions & 28 deletions src/Files.App/Data/Contracts/IFileExplorerService.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Files.App/Data/Contracts/IFileTagsService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.Storables;

namespace Files.App.Data.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IFileTagsSettingsService : IBaseSettingsService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IFoldersSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IGeneralSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.ComponentModel;

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IInfoPaneSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface ILayoutSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Contracts/IRemovableDrivesService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.Storables;

namespace Files.App.Data.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Services.Settings
namespace Files.App.Data.Contracts
{
public interface IUserSettingsService : IBaseSettingsService
{
Expand Down
10 changes: 0 additions & 10 deletions src/Files.App/Data/Contracts/IVolumeInfoFactory.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Files.App/Data/Contracts/ImagingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.Storables;
using Files.Shared.Utils;
using Windows.Storage.FileProperties;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/DriveItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Storage.WindowsStorage;
using Files.App.Storage.Storables;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Models/DrivesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See the LICENSE.

using Files.App.Services.SizeProvider;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.Storables;
using Microsoft.Extensions.Logging;
using System.IO;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Models/IStorageDeviceWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.Storables;
using System;

namespace Files.App.Data.Models
Expand Down
8 changes: 2 additions & 6 deletions src/Files.App/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
global using global::Files.App.Data.Enums;
global using global::Files.App.Data.Messages;
global using global::Files.App.Services.DateTimeFormatter;
global using global::Files.App.Services.PreviewPopupProviders;
global using global::Files.App.Services.Settings;
global using global::Files.App.ViewModels.Dialogs;
global using global::Files.App.ViewModels.Dialogs.AddItemDialog;
Expand All @@ -72,15 +73,10 @@

global using global::Files.Core.Storage;
global using global::Files.Core.Storage.Contracts;
global using global::Files.Core.Storage.DirectStorage;
global using global::Files.Core.Storage.Storables;
global using global::Files.Core.Storage.Enums;
global using global::Files.Core.Storage.EventArguments;
global using global::Files.Core.Storage.ExtendableStorage;
global using global::Files.Core.Storage.Extensions;
global using global::Files.Core.Storage.LocatableStorage;
global using global::Files.Core.Storage.ModifiableStorage;
global using global::Files.Core.Storage.MutableStorage;
global using global::Files.Core.Storage.NestedStorage;
global using global::Files.Core.Storage.StorageEnumeration;

// Files.Shared
Expand Down
5 changes: 2 additions & 3 deletions src/Files.App/Helpers/Application/AppLifecycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using CommunityToolkit.WinUI.Notifications;
using Files.App.Services.DateTimeFormatter;
using Files.App.Services.Settings;
using Files.App.Storage.FtpStorage;
using Files.App.Storage.NativeStorage;
using Files.App.Storage.Storables;
using Files.App.Storage.Storables;
using Files.App.ViewModels.Settings;
using Files.App.Services.SizeProvider;
using Files.Core.Storage;
Expand Down Expand Up @@ -185,7 +185,6 @@ public static IHost ConfigureHost()
.AddSingleton<IPreviewPopupService, PreviewPopupService>()
.AddSingleton<IDateTimeFormatterFactory, DateTimeFormatterFactory>()
.AddSingleton<IDateTimeFormatter, UserDateTimeFormatter>()
.AddSingleton<IVolumeInfoFactory, VolumeInfoFactory>()
.AddSingleton<ISizeProvider, UserSizeProvider>()
.AddSingleton<IQuickAccessService, QuickAccessService>()
.AddSingleton<IResourcesService, ResourcesService>()
Expand Down
Loading
Loading