Skip to content
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

Code quality: Seal all non-inherited classes to improve performance #14990

Merged
merged 4 commits into from Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class SetAsLockscreenBackgroundAction : BaseSetAsAction
internal sealed class SetAsLockscreenBackgroundAction : BaseSetAsAction
{
public override string Label
=> "SetAsLockscreen".GetLocalizedResource();
Expand Down
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class SetAsSlideshowBackgroundAction : BaseSetAsAction
internal sealed class SetAsSlideshowBackgroundAction : BaseSetAsAction
{
public override string Label
=> "SetAsSlideshow".GetLocalizedResource();
Expand Down
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class SetAsWallpaperBackgroundAction : BaseSetAsAction
internal sealed class SetAsWallpaperBackgroundAction : BaseSetAsAction
{
public override string Label
=> "SetAsBackground".GetLocalizedResource();
Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class RotateLeftAction : BaseRotateAction
internal sealed class RotateLeftAction : BaseRotateAction
{
public override string Label
=> "RotateLeft".GetLocalizedResource();
Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class RotateRightAction : BaseRotateAction
internal sealed class RotateRightAction : BaseRotateAction
{
public override string Label
=> "RotateRight".GetLocalizedResource();
Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class InstallCertificateAction : ObservableObject, IAction
internal sealed class InstallCertificateAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Content/Install/InstallFontAction.cs
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class InstallFontAction : ObservableObject, IAction
internal sealed class InstallFontAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class InstallInfDriverAction : ObservableObject, IAction
internal sealed class InstallInfDriverAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Content/PlayAllAction.cs
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class PlayAllAction : ObservableObject, IAction
internal sealed class PlayAllAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class LaunchPreviewPopupAction : ObservableObject, IAction
internal sealed class LaunchPreviewPopupAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Content/RefreshItemsAction.cs
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class RefreshItemsAction : ObservableObject, IAction
internal sealed class RefreshItemsAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class RunWithPowershellAction : ObservableObject, IAction
internal sealed class RunWithPowershellAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class ClearSelectionAction : IAction
internal sealed class ClearSelectionAction : IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class InvertSelectionAction : IAction
internal sealed class InvertSelectionAction : IAction
{
private readonly IContentPageContext context;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Content/Selection/SelectAllAction.cs
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class SelectAllAction : IAction
internal sealed class SelectAllAction : IAction
{
private readonly IContentPageContext context;

Expand Down
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Actions
{
internal class ToggleSelectAction : IAction
internal sealed class ToggleSelectAction : IAction
{
public string Label
=> "ToggleSelect".GetLocalizedResource();
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Content/Share/ShareItemAction.cs
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Actions
{
internal class ShareItemAction : ObservableObject, IAction
internal sealed class ShareItemAction : ObservableObject, IAction
{
private readonly IContentPageContext context;

Expand Down
52 changes: 26 additions & 26 deletions src/Files.App/Actions/Display/GroupAction.cs
Expand Up @@ -3,7 +3,7 @@

namespace Files.App.Actions
{
internal class GroupByNoneAction : GroupByAction
internal sealed class GroupByNoneAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.None;
Expand All @@ -15,7 +15,7 @@ public override string Description
=> "GroupByNoneDescription".GetLocalizedResource();
}

internal class GroupByNameAction : GroupByAction
internal sealed class GroupByNameAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.Name;
Expand All @@ -27,7 +27,7 @@ public override string Description
=> "GroupByNameDescription".GetLocalizedResource();
}

internal class GroupByDateModifiedAction : GroupByAction
internal sealed class GroupByDateModifiedAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.DateModified;
Expand All @@ -39,7 +39,7 @@ public override string Description
=> "GroupByDateModifiedDescription".GetLocalizedResource();
}

internal class GroupByDateCreatedAction : GroupByAction
internal sealed class GroupByDateCreatedAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.DateCreated;
Expand All @@ -51,7 +51,7 @@ public override string Description
=> "GroupByDateCreatedDescription".GetLocalizedResource();
}

internal class GroupBySizeAction : GroupByAction
internal sealed class GroupBySizeAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.Size;
Expand All @@ -63,7 +63,7 @@ public override string Description
=> "GroupBySizeDescription".GetLocalizedResource();
}

internal class GroupByTypeAction : GroupByAction
internal sealed class GroupByTypeAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.FileType;
Expand All @@ -75,7 +75,7 @@ public override string Description
=> "GroupByTypeDescription".GetLocalizedResource();
}

internal class GroupBySyncStatusAction : GroupByAction
internal sealed class GroupBySyncStatusAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.SyncStatus;
Expand All @@ -90,7 +90,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType)
=> pageType is ContentPageTypes.CloudDrive;
}

internal class GroupByTagAction : GroupByAction
internal sealed class GroupByTagAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.FileTag;
Expand All @@ -102,7 +102,7 @@ public override string Description
=> "GroupByTagDescription".GetLocalizedResource();
}

internal class GroupByOriginalFolderAction : GroupByAction
internal sealed class GroupByOriginalFolderAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.OriginalFolder;
Expand All @@ -117,7 +117,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType)
=> pageType is ContentPageTypes.RecycleBin;
}

internal class GroupByDateDeletedAction : GroupByAction
internal sealed class GroupByDateDeletedAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.DateDeleted;
Expand All @@ -132,7 +132,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType)
=> pageType is ContentPageTypes.RecycleBin;
}

internal class GroupByFolderPathAction : GroupByAction
internal sealed class GroupByFolderPathAction : GroupByAction
{
protected override GroupOption GroupOption
=> GroupOption.FolderPath;
Expand Down Expand Up @@ -199,7 +199,7 @@ private void DisplayContext_PropertyChanged(object? sender, PropertyChangedEvent
}
}

internal class GroupByDateModifiedYearAction : GroupByDateAction
internal sealed class GroupByDateModifiedYearAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateModified;
Expand All @@ -214,7 +214,7 @@ public override string Description
=> "GroupByDateModifiedYearDescription".GetLocalizedResource();
}

internal class GroupByDateModifiedMonthAction : GroupByDateAction
internal sealed class GroupByDateModifiedMonthAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateModified;
Expand All @@ -229,7 +229,7 @@ public override string Description
=> "GroupByDateModifiedMonthDescription".GetLocalizedResource();
}

internal class GroupByDateModifiedDayAction : GroupByDateAction
internal sealed class GroupByDateModifiedDayAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateModified;
Expand All @@ -244,7 +244,7 @@ public override string Description
=> "GroupByDateModifiedDayDescription".GetLocalizedResource();
}

internal class GroupByDateCreatedYearAction : GroupByDateAction
internal sealed class GroupByDateCreatedYearAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateCreated;
Expand All @@ -259,7 +259,7 @@ public override string Description
=> "GroupByDateCreatedYearDescription".GetLocalizedResource();
}

internal class GroupByDateCreatedMonthAction : GroupByDateAction
internal sealed class GroupByDateCreatedMonthAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateCreated;
Expand All @@ -274,7 +274,7 @@ public override string Description
=> "GroupByDateCreatedMonthDescription".GetLocalizedResource();
}

internal class GroupByDateCreatedDayAction : GroupByDateAction
internal sealed class GroupByDateCreatedDayAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateCreated;
Expand All @@ -289,7 +289,7 @@ public override string Description
=> "GroupByDateCreatedDayDescription".GetLocalizedResource();
}

internal class GroupByDateDeletedYearAction : GroupByDateAction
internal sealed class GroupByDateDeletedYearAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateDeleted;
Expand All @@ -307,7 +307,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType)
=> pageType is ContentPageTypes.RecycleBin;
}

internal class GroupByDateDeletedMonthAction : GroupByDateAction
internal sealed class GroupByDateDeletedMonthAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateDeleted;
Expand All @@ -325,7 +325,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType)
=> pageType is ContentPageTypes.RecycleBin;
}

internal class GroupByDateDeletedDayAction : GroupByDateAction
internal sealed class GroupByDateDeletedDayAction : GroupByDateAction
{
protected override GroupOption GroupOption
=> GroupOption.DateDeleted;
Expand Down Expand Up @@ -399,7 +399,7 @@ private void DisplayContext_PropertyChanged(object? sender, PropertyChangedEvent
}
}

internal class GroupAscendingAction : ObservableObject, IToggleAction
internal sealed class GroupAscendingAction : ObservableObject, IToggleAction
{
private readonly IDisplayPageContext context;

Expand Down Expand Up @@ -443,7 +443,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
}
}

internal class GroupDescendingAction : ObservableObject, IToggleAction
internal sealed class GroupDescendingAction : ObservableObject, IToggleAction
{
private readonly IDisplayPageContext context;

Expand Down Expand Up @@ -487,7 +487,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
}
}

internal class ToggleGroupDirectionAction : IAction
internal sealed class ToggleGroupDirectionAction : IAction
{
private readonly IDisplayPageContext context;

Expand All @@ -510,7 +510,7 @@ public Task ExecuteAsync()
}
}

internal class GroupByYearAction : ObservableObject, IToggleAction
internal sealed class GroupByYearAction : ObservableObject, IToggleAction
{
private readonly IDisplayPageContext context;

Expand Down Expand Up @@ -554,7 +554,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
}
}

internal class GroupByMonthAction : ObservableObject, IToggleAction
internal sealed class GroupByMonthAction : ObservableObject, IToggleAction
{
private readonly IDisplayPageContext context;

Expand Down Expand Up @@ -598,7 +598,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
}
}

internal class ToggleGroupByDateUnitAction : IAction
internal sealed class ToggleGroupByDateUnitAction : IAction
{
private readonly IDisplayPageContext context;

Expand Down