Skip to content

Commit 794e7e4

Browse files
authored
Code Quality: Moved App.Commands & App.Contexts to App.Data (#12887)
1 parent 471c1a0 commit 794e7e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+55
-71
lines changed

src/Files.App/Actions/FileSystem/PasteItemAction.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using CommunityToolkit.Mvvm.ComponentModel;
55
using CommunityToolkit.Mvvm.DependencyInjection;
6-
using Files.App.Commands;
7-
using Files.App.Contexts;
86
using Files.App.Data.Models;
97
using Files.App.Extensions;
108
using Files.App.Helpers;

src/Files.App/Actions/Git/GitInitAction.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Contexts;
5-
64
namespace Files.App.Actions
75
{
86
sealed class GitInitAction : ObservableObject, IAction

src/Files.App/Actions/Git/GitPushAction.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Commands;
5-
using Files.App.Contexts;
6-
74
namespace Files.App.Actions
85
{
96
internal class GitPushAction : ObservableObject, IAction

src/Files.App/Actions/Git/GitSyncAction.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Commands;
5-
using Files.App.Contexts;
6-
74
namespace Files.App.Actions
85
{
96
internal class GitSyncAction : ObservableObject, IAction

src/Files.App/Actions/Open/OpenInVSAction.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Contexts;
54
using Files.App.Utils.Shell;
65

76
namespace Files.App.Actions

src/Files.App/Actions/Open/OpenInVSCodeAction.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Contexts;
54
using Files.App.Utils.Shell;
65

76
namespace Files.App.Actions

src/Files.App/Actions/Open/OpenPropertiesAction.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Commands;
5-
using Files.App.Contexts;
6-
74
namespace Files.App.Actions
85
{
96
internal class OpenPropertiesAction : ObservableObject, IAction

src/Files.App/Actions/Show/ToggleSidebarAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using CommunityToolkit.Mvvm.ComponentModel;
55
using CommunityToolkit.Mvvm.DependencyInjection;
6-
using Files.App.Commands;
6+
using Files.App.Data.Commands;
77
using Files.App.Extensions;
88
using Files.App.ViewModels;
99
using System.ComponentModel;

src/Files.App/App.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using CommunityToolkit.WinUI.Helpers;
55
using CommunityToolkit.WinUI.Notifications;
6-
using Files.App.Commands;
7-
using Files.App.Contexts;
86
using Files.App.Data.Models;
97
using Files.App.Extensions;
108
using Files.App.Utils;

src/Files.App/Data/Attributes/DependencyPropertyAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using Microsoft.UI.Xaml;
55

6-
namespace Files.App.Attributes
6+
namespace Files.App.Data.Attributes
77
{
88
/// <summary>
99
/// Provides an attribute for generation of <see cref="DependencyProperty"/> and its Property.
@@ -21,9 +21,9 @@ namespace Files.App.Attributes
2121
/// <br/>
2222
/// <see langword="public"/> <typeparamref name="T"/> Field
2323
/// {
24-
/// <see langword="get"/> => (<typeparamref name="T"/>)GetValue(Property);
25-
/// <see langword="set"/> => SetValue(Property, <see langword="value"/>);
26-
/// }
24+
/// <see langword="get"/> => (<typeparamref name="T"/>)GetValue(Property);
25+
/// <see langword="set"/> => SetValue(Property, <see langword="value"/>);
26+
/// }
2727
/// </code>
2828
/// <typeparam name="T">property type (nullable value type are not allowed)</typeparam>
2929
/// </remarks>

src/Files.App/Commands/CommandCodes.cs renamed to src/Files.App/Data/Commands/CommandCodes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Commands
4+
namespace Files.App.Data.Commands
55
{
66
public enum CommandCodes
77
{

src/Files.App/Commands/HotKey/HotKey.cs renamed to src/Files.App/Data/Commands/HotKey/HotKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Text;
77
using Forms = System.Windows.Forms;
88

9-
namespace Files.App.Commands
9+
namespace Files.App.Data.Commands
1010
{
1111
[DebuggerDisplay("{Code}")]
1212
public readonly struct HotKey : IEquatable<HotKey>

src/Files.App/Commands/HotKey/HotKeyCollection.cs renamed to src/Files.App/Data/Commands/HotKey/HotKeyCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Diagnostics;
77
using System.Linq;
88

9-
namespace Files.App.Commands
9+
namespace Files.App.Data.Commands
1010
{
1111
[DebuggerDisplay("{Code}")]
1212
public readonly struct HotKeyCollection : IEnumerable<HotKey>, IEquatable<HotKeyCollection>

src/Files.App/Commands/HotKey/HotKeyHelpers.cs renamed to src/Files.App/Data/Commands/HotKey/HotKeyHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Windows.System;
88
using Windows.UI.Core;
99

10-
namespace Files.App.Commands
10+
namespace Files.App.Data.Commands
1111
{
1212
internal static class HotKeyHelpers
1313
{

src/Files.App/Commands/HotKey/KeyModifiers.cs renamed to src/Files.App/Data/Commands/HotKey/KeyModifiers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System;
55

6-
namespace Files.App.Commands
6+
namespace Files.App.Data.Commands
77
{
88
[Flags]
99
public enum KeyModifiers : ushort

src/Files.App/Commands/HotKey/Keys.cs renamed to src/Files.App/Data/Commands/HotKey/Keys.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using Windows.System;
55

6-
namespace Files.App.Commands
6+
namespace Files.App.Data.Commands
77
{
88
public enum Keys : ushort
99
{

src/Files.App/Commands/IRichCommand.cs renamed to src/Files.App/Data/Commands/IRichCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Threading.Tasks;
99
using System.Windows.Input;
1010

11-
namespace Files.App.Commands
11+
namespace Files.App.Data.Commands
1212
{
1313
public interface IRichCommand : ICommand, INotifyPropertyChanging, INotifyPropertyChanged
1414
{

src/Files.App/Commands/Manager/CommandManager.cs renamed to src/Files.App/Data/Commands/Manager/CommandManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Microsoft.UI.Xaml.Input;
99
using System.Collections.Immutable;
1010

11-
namespace Files.App.Commands
11+
namespace Files.App.Data.Commands
1212
{
1313
internal class CommandManager : ICommandManager
1414
{

src/Files.App/Commands/Manager/ICommandManager.cs renamed to src/Files.App/Data/Commands/Manager/ICommandManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Commands
4+
namespace Files.App.Data.Commands
55
{
66
public interface ICommandManager : IEnumerable<IRichCommand>
77
{

src/Files.App/Commands/Manager/IModifiableCommandManager.cs renamed to src/Files.App/Data/Commands/Manager/IModifiableCommandManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Commands
4+
namespace Files.App.Data.Commands
55
{
66
public interface IModifiableCommandManager : IEnumerable<IRichCommand>
77
{

src/Files.App/Commands/Manager/ModifiableCommandManager.cs renamed to src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Collections.Immutable;
55

6-
namespace Files.App.Commands
6+
namespace Files.App.Data.Commands
77
{
88
internal class ModifiableCommandManager : IModifiableCommandManager
99
{

src/Files.App/Commands/ModifiableCommand.cs renamed to src/Files.App/Data/Commands/ModifiableCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
using Microsoft.UI.Xaml.Controls;
77
using Microsoft.UI.Xaml.Input;
88
using System.Collections.Immutable;
9-
using static Files.App.Commands.CommandManager;
9+
using static Files.App.Data.Commands.CommandManager;
1010

11-
namespace Files.App.Commands
11+
namespace Files.App.Data.Commands
1212
{
1313
[DebuggerDisplay("Command {Code} (Modifiable)")]
1414
internal class ModifiableCommand : ObservableObject, IRichCommand

src/Files.App/Commands/NoneCommand.cs renamed to src/Files.App/Data/Commands/NoneCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.UI.Xaml.Controls;
66
using Microsoft.UI.Xaml.Input;
77

8-
namespace Files.App.Commands
8+
namespace Files.App.Data.Commands
99
{
1010
[DebuggerDisplay("Command None")]
1111
internal class NoneCommand : IRichCommand

src/Files.App/Commands/RichGlyph.cs renamed to src/Files.App/Data/Commands/RichGlyph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Microsoft.UI.Xaml.Media;
88
using static Microsoft.UI.Xaml.Application;
99

10-
namespace Files.App.Commands
10+
namespace Files.App.Data.Commands
1111
{
1212
public readonly struct RichGlyph
1313
{

src/Files.App/Contexts/ContentPage/ContentPageContext.cs renamed to src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Files.App.UserControls.MultitaskingControl;
55
using System.Collections.Immutable;
66

7-
namespace Files.App.Contexts
7+
namespace Files.App.Data.Contexts
88
{
99
internal class ContentPageContext : ObservableObject, IContentPageContext
1010
{

src/Files.App/Contexts/ContentPage/ContentPageTypes.cs renamed to src/Files.App/Data/Contexts/ContentPage/ContentPageTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Contexts
4+
namespace Files.App.Data.Contexts
55
{
66
public enum ContentPageTypes : ushort
77
{

src/Files.App/Contexts/ContentPage/IContentPageContext.cs renamed to src/Files.App/Data/Contexts/ContentPage/IContentPageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Contexts
4+
namespace Files.App.Data.Contexts
55
{
66
public interface IContentPageContext : INotifyPropertyChanged
77
{

src/Files.App/Contexts/DisplayPage/DisplayPageContext.cs renamed to src/Files.App/Data/Contexts/DisplayPage/DisplayPageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using static Files.App.Constants.Browser.GridViewBrowser;
55

6-
namespace Files.App.Contexts
6+
namespace Files.App.Data.Contexts
77
{
88
internal class DisplayPageContext : ObservableObject, IDisplayPageContext
99
{

src/Files.App/Contexts/DisplayPage/IDisplayPageContext.cs renamed to src/Files.App/Data/Contexts/DisplayPage/IDisplayPageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Contexts
4+
namespace Files.App.Data.Contexts
55
{
66
public interface IDisplayPageContext : INotifyPropertyChanging, INotifyPropertyChanged
77
{

src/Files.App/Contexts/DisplayPage/LayoutTypes.cs renamed to src/Files.App/Data/Contexts/DisplayPage/LayoutTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
namespace Files.App.Contexts
4+
namespace Files.App.Data.Contexts
55
{
66
public enum LayoutTypes : ushort
77
{

src/Files.App/Contexts/Multitasking/IMultitaskingContext.cs renamed to src/Files.App/Data/Contexts/Multitasking/IMultitaskingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Files.App.UserControls.MultitaskingControl;
55
using System.ComponentModel;
66

7-
namespace Files.App.Contexts
7+
namespace Files.App.Data.Contexts
88
{
99
public interface IMultitaskingContext : INotifyPropertyChanged
1010
{

src/Files.App/Contexts/Multitasking/MultitaskingContext.cs renamed to src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Collections.Specialized;
1010
using System.ComponentModel;
1111

12-
namespace Files.App.Contexts
12+
namespace Files.App.Data.Contexts
1313
{
1414
internal class MultitaskingContext : ObservableObject, IMultitaskingContext
1515
{

src/Files.App/Contexts/Page/IPageContext.cs renamed to src/Files.App/Data/Contexts/Page/IPageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System;
55

6-
namespace Files.App.Contexts
6+
namespace Files.App.Data.Contexts
77
{
88
public interface IPageContext
99
{

src/Files.App/Contexts/Page/PageContext.cs renamed to src/Files.App/Data/Contexts/Page/PageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using System.ComponentModel;
88

9-
namespace Files.App.Contexts
9+
namespace Files.App.Data.Contexts
1010
{
1111
internal class PageContext : IPageContext
1212
{

src/Files.App/Contexts/Window/IWindowContext.cs renamed to src/Files.App/Data/Contexts/Window/IWindowContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.ComponentModel;
55

6-
namespace Files.App.Contexts
6+
namespace Files.App.Data.Contexts
77
{
88
public interface IWindowContext : INotifyPropertyChanged
99
{

src/Files.App/Contexts/Window/WindowContext.cs renamed to src/Files.App/Data/Contexts/Window/WindowContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using CommunityToolkit.Mvvm.ComponentModel;
55
using Microsoft.UI.Windowing;
66

7-
namespace Files.App.Contexts
7+
namespace Files.App.Data.Contexts
88
{
99
internal class WindowContext : ObservableObject, IWindowContext
1010
{

src/Files.App/Data/Models/ContextMenuFlyoutItemViewModelBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Commands;
4+
using Files.App.Data.Commands;
55

66
namespace Files.App.Data.Models
77
{

src/Files.App/GlobalUsings.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
global using global::CommunityToolkit.Mvvm.Input;
2020
global using global::CommunityToolkit.Mvvm.Messaging;
2121

22-
// Files.App
23-
global using global::Files.App.Commands;
24-
global using global::Files.App.Contexts;
22+
// Files Front-end
2523
global using global::Files.App.Helpers;
2624
global using global::Files.App.Extensions;
2725
global using global::Files.App.Utils;
@@ -39,11 +37,17 @@
3937
global using global::Files.App.Utils.Shell;
4038
global using global::Files.App.Utils.StorageEnumerators;
4139
global using global::Files.App.Utils.StorageItems;
40+
global using global::Files.App.Data.Attributes;
41+
global using global::Files.App.Data.Behaviors;
42+
global using global::Files.App.Data.Commands;
43+
global using global::Files.App.Data.Contexts;
4244
global using global::Files.App.Data.EventArguments;
45+
global using global::Files.App.Data.Exceptions;
4346
global using global::Files.App.Data.Factories;
4447
global using global::Files.App.Data.Items;
4548
global using global::Files.App.Data.Models;
4649
global using global::Files.App.Data.Parameters;
50+
global using global::Files.App.Data.TemplateSelectors;
4751
global using global::Files.App.UserControls;
4852
global using global::Files.App.ViewModels;
4953
global using global::Files.App.ViewModels.UserControls;

src/Files.App/Helpers/MenuFlyout/ContextFlyoutItemHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using Files.App.Commands;
4+
using Files.App.Data.Commands;
55
using Files.App.ViewModels.LayoutModes;
66
using Microsoft.UI.Xaml.Media.Imaging;
77
using System.IO;

src/Files.App/UserControls/AddressToolbar.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License. See the LICENSE.
33

44
using CommunityToolkit.Mvvm.DependencyInjection;
5-
using Files.App.Commands;
5+
using Files.App.Data.Commands;
66
using Files.App.ViewModels;
77
using Files.Core.Services.Settings;
88
using Microsoft.UI.Input;

0 commit comments

Comments
 (0)