Skip to content

Code Quality: Moved App.Commands & App.Contexts to App.Data #12887

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 6 commits into from
Jul 14, 2023
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
2 changes: 0 additions & 2 deletions src/Files.App/Actions/FileSystem/PasteItemAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using Files.App.Commands;
using Files.App.Contexts;
using Files.App.Data.Models;
using Files.App.Extensions;
using Files.App.Helpers;
Expand Down
2 changes: 0 additions & 2 deletions src/Files.App/Actions/Git/GitInitAction.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Contexts;

namespace Files.App.Actions
{
sealed class GitInitAction : ObservableObject, IAction
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Actions/Git/GitPushAction.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Commands;
using Files.App.Contexts;

namespace Files.App.Actions
{
internal class GitPushAction : ObservableObject, IAction
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Actions/Git/GitSyncAction.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Commands;
using Files.App.Contexts;

namespace Files.App.Actions
{
internal class GitSyncAction : ObservableObject, IAction
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Actions/Open/OpenInVSAction.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Contexts;
using Files.App.Utils.Shell;

namespace Files.App.Actions
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Actions/Open/OpenInVSCodeAction.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Contexts;
using Files.App.Utils.Shell;

namespace Files.App.Actions
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Actions/Open/OpenPropertiesAction.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Commands;
using Files.App.Contexts;

namespace Files.App.Actions
{
internal class OpenPropertiesAction : ObservableObject, IAction
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Show/ToggleSidebarAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using Files.App.Commands;
using Files.App.Data.Commands;
using Files.App.Extensions;
using Files.App.ViewModels;
using System.ComponentModel;
Expand Down
2 changes: 0 additions & 2 deletions src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

using CommunityToolkit.WinUI.Helpers;
using CommunityToolkit.WinUI.Notifications;
using Files.App.Commands;
using Files.App.Contexts;
using Files.App.Data.Models;
using Files.App.Extensions;
using Files.App.Utils;
Expand Down
8 changes: 4 additions & 4 deletions src/Files.App/Data/Attributes/DependencyPropertyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.UI.Xaml;

namespace Files.App.Attributes
namespace Files.App.Data.Attributes
{
/// <summary>
/// Provides an attribute for generation of <see cref="DependencyProperty"/> and its Property.
Expand All @@ -21,9 +21,9 @@ namespace Files.App.Attributes
/// <br/>
/// <see langword="public"/> <typeparamref name="T"/> Field
/// {
/// <see langword="get"/> => (<typeparamref name="T"/>)GetValue(Property);
/// <see langword="set"/> => SetValue(Property, <see langword="value"/>);
/// }
/// <see langword="get"/> => (<typeparamref name="T"/>)GetValue(Property);
/// <see langword="set"/> => SetValue(Property, <see langword="value"/>);
/// }
/// </code>
/// <typeparam name="T">property type (nullable value type are not allowed)</typeparam>
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public enum CommandCodes
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using Forms = System.Windows.Forms;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
[DebuggerDisplay("{Code}")]
public readonly struct HotKey : IEquatable<HotKey>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Diagnostics;
using System.Linq;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
[DebuggerDisplay("{Code}")]
public readonly struct HotKeyCollection : IEnumerable<HotKey>, IEquatable<HotKeyCollection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Windows.System;
using Windows.UI.Core;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
internal static class HotKeyHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
[Flags]
public enum KeyModifiers : ushort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Windows.System;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public enum Keys : ushort
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading.Tasks;
using System.Windows.Input;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public interface IRichCommand : ICommand, INotifyPropertyChanging, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.UI.Xaml.Input;
using System.Collections.Immutable;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
internal class CommandManager : ICommandManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public interface ICommandManager : IEnumerable<IRichCommand>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public interface IModifiableCommandManager : IEnumerable<IRichCommand>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Collections.Immutable;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
internal class ModifiableCommandManager : IModifiableCommandManager
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using System.Collections.Immutable;
using static Files.App.Commands.CommandManager;
using static Files.App.Data.Commands.CommandManager;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
[DebuggerDisplay("Command {Code} (Modifiable)")]
internal class ModifiableCommand : ObservableObject, IRichCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
[DebuggerDisplay("Command None")]
internal class NoneCommand : IRichCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.UI.Xaml.Media;
using static Microsoft.UI.Xaml.Application;

namespace Files.App.Commands
namespace Files.App.Data.Commands
{
public readonly struct RichGlyph
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Files.App.UserControls.MultitaskingControl;
using System.Collections.Immutable;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
internal class ContentPageContext : ObservableObject, IContentPageContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public enum ContentPageTypes : ushort
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public interface IContentPageContext : INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
internal class DisplayPageContext : ObservableObject, IDisplayPageContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public interface IDisplayPageContext : INotifyPropertyChanging, INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public enum LayoutTypes : ushort
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Files.App.UserControls.MultitaskingControl;
using System.ComponentModel;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public interface IMultitaskingContext : INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Collections.Specialized;
using System.ComponentModel;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
internal class MultitaskingContext : ObservableObject, IMultitaskingContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public interface IPageContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using System.ComponentModel;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
internal class PageContext : IPageContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.ComponentModel;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
public interface IWindowContext : INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Windowing;

namespace Files.App.Contexts
namespace Files.App.Data.Contexts
{
internal class WindowContext : ObservableObject, IWindowContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Commands;
using Files.App.Data.Commands;

namespace Files.App.Data.Models
{
Expand Down
10 changes: 7 additions & 3 deletions src/Files.App/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
global using global::CommunityToolkit.Mvvm.Input;
global using global::CommunityToolkit.Mvvm.Messaging;

// Files.App
global using global::Files.App.Commands;
global using global::Files.App.Contexts;
// Files Front-end
global using global::Files.App.Helpers;
global using global::Files.App.Extensions;
global using global::Files.App.Utils;
Expand All @@ -39,11 +37,17 @@
global using global::Files.App.Utils.Shell;
global using global::Files.App.Utils.StorageEnumerators;
global using global::Files.App.Utils.StorageItems;
global using global::Files.App.Data.Attributes;
global using global::Files.App.Data.Behaviors;
global using global::Files.App.Data.Commands;
global using global::Files.App.Data.Contexts;
global using global::Files.App.Data.EventArguments;
global using global::Files.App.Data.Exceptions;
global using global::Files.App.Data.Factories;
global using global::Files.App.Data.Items;
global using global::Files.App.Data.Models;
global using global::Files.App.Data.Parameters;
global using global::Files.App.Data.TemplateSelectors;
global using global::Files.App.UserControls;
global using global::Files.App.ViewModels;
global using global::Files.App.ViewModels.UserControls;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Commands;
using Files.App.Data.Commands;
using Files.App.ViewModels.LayoutModes;
using Microsoft.UI.Xaml.Media.Imaging;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/UserControls/AddressToolbar.xaml.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 CommunityToolkit.Mvvm.DependencyInjection;
using Files.App.Commands;
using Files.App.Data.Commands;
using Files.App.ViewModels;
using Files.Core.Services.Settings;
using Microsoft.UI.Input;
Expand Down
Loading