Skip to content

Commit 60b266a

Browse files
authored
Code Quality: Added 'object? parameter' to every rich commands (#15325)
1 parent c101b44 commit 60b266a

File tree

112 files changed

+342
-153
lines changed

Some content is hidden

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

112 files changed

+342
-153
lines changed

src/Files.App/Actions/Content/Archives/Compress/BaseCompressArchiveAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public BaseCompressArchiveAction()
2323
context.PropertyChanged += Context_PropertyChanged;
2424
}
2525

26-
public abstract Task ExecuteAsync();
26+
public abstract Task ExecuteAsync(object? parameter = null);
2727

2828
private bool IsContextPageTypeAdaptedToCommand()
2929
{

src/Files.App/Actions/Content/Archives/Compress/CompressIntoArchiveAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public CompressIntoArchiveAction()
1919
{
2020
}
2121

22-
public override async Task ExecuteAsync()
22+
public override async Task ExecuteAsync(object? parameter = null)
2323
{
2424
if (context.ShellPage is null)
2525
return;

src/Files.App/Actions/Content/Archives/Compress/CompressIntoSevenZipAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CompressIntoSevenZipAction()
1515
{
1616
}
1717

18-
public override Task ExecuteAsync()
18+
public override Task ExecuteAsync(object? parameter = null)
1919
{
2020
if (context.ShellPage is null)
2121
return Task.CompletedTask;

src/Files.App/Actions/Content/Archives/Compress/CompressIntoZipAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CompressIntoZipAction()
1515
{
1616
}
1717

18-
public override Task ExecuteAsync()
18+
public override Task ExecuteAsync(object? parameter = null)
1919
{
2020
if (context.ShellPage is null)
2121
return Task.CompletedTask;

src/Files.App/Actions/Content/Archives/Decompress/BaseDecompressArchiveAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public BaseDecompressArchiveAction()
2727
context.PropertyChanged += Context_PropertyChanged;
2828
}
2929

30-
public abstract Task ExecuteAsync();
30+
public abstract Task ExecuteAsync(object? parameter = null);
3131

3232
protected bool IsContextPageTypeAdaptedToCommand()
3333
{

src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public DecompressArchive()
2121
{
2222
}
2323

24-
public override Task ExecuteAsync()
24+
public override Task ExecuteAsync(object? parameter = null)
2525
{
2626
if (context.ShellPage is null)
2727
return Task.CompletedTask;

src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHere.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public DecompressArchiveHere()
1515
{
1616
}
1717

18-
public override Task ExecuteAsync()
18+
public override Task ExecuteAsync(object? parameter = null)
1919
{
2020
return DecompressHelper.DecompressArchiveHereAsync(context.ShellPage);
2121
}

src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHereSmart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public DecompressArchiveHereSmart()
1818
{
1919
}
2020

21-
public override Task ExecuteAsync()
21+
public override Task ExecuteAsync(object? parameter = null)
2222
{
2323
return DecompressHelper.DecompressArchiveHereAsync(context.ShellPage, true);
2424
}

src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveToChildFolderAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public DecompressArchiveToChildFolderAction()
1515
{
1616
}
1717

18-
public override Task ExecuteAsync()
18+
public override Task ExecuteAsync(object? parameter = null)
1919
{
2020
return DecompressHelper.DecompressArchiveToChildFolderAsync(context.ShellPage);
2121
}

src/Files.App/Actions/Content/Background/BaseSetAsAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public BaseSetAsAction()
2626
context.PropertyChanged += Context_PropertyChanged;
2727
}
2828

29-
public abstract Task ExecuteAsync();
29+
public abstract Task ExecuteAsync(object? parameter = null);
3030

3131
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
3232
{

src/Files.App/Actions/Content/Background/SetAsAppBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override RichGlyph Glyph
2020
base.IsExecutable &&
2121
context.SelectedItem is not null;
2222

23-
public override Task ExecuteAsync()
23+
public override Task ExecuteAsync(object? parameter = null)
2424
{
2525
if (context.SelectedItem is not null)
2626
AppearanceSettingsService.AppThemeBackgroundImageSource = context.SelectedItem.ItemPath;

src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override RichGlyph Glyph
1818
base.IsExecutable &&
1919
context.SelectedItem is not null;
2020

21-
public override Task ExecuteAsync()
21+
public override Task ExecuteAsync(object? parameter = null)
2222
{
2323
if (context.SelectedItem is not null)
2424
return WallpaperHelpers.SetAsBackgroundAsync(WallpaperType.LockScreen, context.SelectedItem.ItemPath);

src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override RichGlyph Glyph
1818
base.IsExecutable &&
1919
context.SelectedItems.Count > 1;
2020

21-
public override Task ExecuteAsync()
21+
public override Task ExecuteAsync(object? parameter = null)
2222
{
2323
var paths = context.SelectedItems.Select(item => item.ItemPath).ToArray();
2424
WallpaperHelpers.SetSlideshow(paths);

src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override RichGlyph Glyph
1818
base.IsExecutable &&
1919
context.SelectedItem is not null;
2020

21-
public override Task ExecuteAsync()
21+
public override Task ExecuteAsync(object? parameter = null)
2222
{
2323
if (context.SelectedItem is not null)
2424
return WallpaperHelpers.SetAsBackgroundAsync(WallpaperType.Desktop, context.SelectedItem.ItemPath);

src/Files.App/Actions/Content/ImageManipulation/BaseRotateAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public BaseRotateAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
await Task.WhenAll(context.SelectedItems.Select(image => BitmapHelper.RotateAsync(PathNormalization.NormalizePath(image.ItemPath), Rotation)));
3737

src/Files.App/Actions/Content/Install/InstallCertificateAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public InstallCertificateAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
await ContextMenu.InvokeVerb("add", context.SelectedItems.Select(x => x.ItemPath).ToArray());
3737
}

src/Files.App/Actions/Content/Install/InstallFontAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public InstallFontAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public Task ExecuteAsync()
34+
public Task ExecuteAsync(object? parameter = null)
3535
{
3636
var paths = context.SelectedItems.Select(item => item.ItemPath).ToArray();
3737
return Win32Helper.InstallFontsAsync(paths, false);

src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public InstallInfDriverAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
await Task.WhenAll(context.SelectedItems.Select(selectedItem => Win32Helper.InstallInf(selectedItem.ItemPath)));
3737
}

src/Files.App/Actions/Content/PlayAllAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public PlayAllAction()
3030
context.PropertyChanged += Context_PropertyChanged;
3131
}
3232

33-
public Task ExecuteAsync()
33+
public Task ExecuteAsync(object? parameter = null)
3434
{
3535
return NavigationHelpers.OpenSelectedItemsAsync(context.ShellPage!);
3636
}

src/Files.App/Actions/Content/PreviewPopup/LaunchPreviewPopupAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public LaunchPreviewPopupAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
var provider = await previewPopupService.GetProviderAsync();
3737
if (provider is null)

src/Files.App/Actions/Content/RefreshItemsAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public RefreshItemsAction()
3232
context.PropertyChanged += Context_PropertyChanged;
3333
}
3434

35-
public async Task ExecuteAsync()
35+
public async Task ExecuteAsync(object? parameter = null)
3636
{
3737
if (context.ShellPage is null)
3838
return;

src/Files.App/Actions/Content/Run/BaseRunAsAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public BaseRunAsAction(string verb)
3131
_context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
await ContextMenu.InvokeVerb(_verb, _context.SelectedItem!.ItemPath);
3737
}

src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public RunWithPowershellAction()
2929
context.PropertyChanged += Context_PropertyChanged;
3030
}
3131

32-
public Task ExecuteAsync()
32+
public Task ExecuteAsync(object? parameter = null)
3333
{
3434
return Win32Helper.RunPowershellCommandAsync($"{context.ShellPage?.SlimContentPage?.SelectedItem?.ItemPath}", false);
3535
}

src/Files.App/Actions/Content/Selection/ClearSelectionAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public ClearSelectionAction()
4343
context = Ioc.Default.GetRequiredService<IContentPageContext>();
4444
}
4545

46-
public Task ExecuteAsync()
46+
public Task ExecuteAsync(object? parameter = null)
4747
{
4848
context.ShellPage?.SlimContentPage?.ItemManipulationModel?.ClearSelection();
4949

src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public InvertSelectionAction()
4343
context = Ioc.Default.GetRequiredService<IContentPageContext>();
4444
}
4545

46-
public Task ExecuteAsync()
46+
public Task ExecuteAsync(object? parameter = null)
4747
{
4848
context?.ShellPage?.SlimContentPage?.ItemManipulationModel?.InvertSelection();
4949

src/Files.App/Actions/Content/Selection/SelectAllAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public SelectAllAction()
4848
context = Ioc.Default.GetRequiredService<IContentPageContext>();
4949
}
5050

51-
public Task ExecuteAsync()
51+
public Task ExecuteAsync(object? parameter = null)
5252
{
5353
context.ShellPage?.SlimContentPage?.ItemManipulationModel?.SelectAllItems();
5454

src/Files.App/Actions/Content/Selection/ToggleSelectAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public HotKey HotKey
2020
public bool IsExecutable
2121
=> GetFocusedElement() is not null;
2222

23-
public Task ExecuteAsync()
23+
public Task ExecuteAsync(object? parameter = null)
2424
{
2525
if (GetFocusedElement() is SelectorItem item)
2626
item.IsSelected = !item.IsSelected;

src/Files.App/Actions/Content/Share/ShareItemAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ShareItemAction()
3131
context.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public Task ExecuteAsync()
34+
public Task ExecuteAsync(object? parameter = null)
3535
{
3636
return ShareItemHelpers.ShareItemsAsync(context.SelectedItems);
3737
}

src/Files.App/Actions/Content/Tags/OpenAllTaggedActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public OpenAllTaggedActions()
3131
_tagsContext.PropertyChanged += Context_PropertyChanged;
3232
}
3333

34-
public async Task ExecuteAsync()
34+
public async Task ExecuteAsync(object? parameter = null)
3535
{
3636
var filePaths = _tagsContext.TaggedItems
3737
.Where(item => !item.isFolder)

src/Files.App/Actions/Display/GroupAction.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public GroupByAction()
176176
DisplayContext.PropertyChanged += DisplayContext_PropertyChanged;
177177
}
178178

179-
public Task ExecuteAsync()
179+
public Task ExecuteAsync(object? parameter = null)
180180
{
181181
DisplayContext.GroupOption = GroupOption;
182182

@@ -375,7 +375,7 @@ public GroupByDateAction()
375375
DisplayContext.PropertyChanged += DisplayContext_PropertyChanged;
376376
}
377377

378-
public Task ExecuteAsync()
378+
public Task ExecuteAsync(object? parameter = null)
379379
{
380380
DisplayContext.GroupOption = GroupOption;
381381
DisplayContext.GroupByDateUnit = GroupByDateUnit;
@@ -424,7 +424,7 @@ public GroupAscendingAction()
424424
context.PropertyChanged += Context_PropertyChanged;
425425
}
426426

427-
public Task ExecuteAsync()
427+
public Task ExecuteAsync(object? parameter = null)
428428
{
429429
context.GroupDirection = SortDirection.Ascending;
430430

@@ -468,7 +468,7 @@ public GroupDescendingAction()
468468
context.PropertyChanged += Context_PropertyChanged;
469469
}
470470

471-
public Task ExecuteAsync()
471+
public Task ExecuteAsync(object? parameter = null)
472472
{
473473
context.GroupDirection = SortDirection.Descending;
474474

@@ -504,7 +504,7 @@ public ToggleGroupDirectionAction()
504504
context = Ioc.Default.GetRequiredService<IDisplayPageContext>();
505505
}
506506

507-
public Task ExecuteAsync()
507+
public Task ExecuteAsync(object? parameter = null)
508508
{
509509
context.GroupDirection = context.SortDirection is SortDirection.Descending ? SortDirection.Ascending : SortDirection.Descending;
510510

@@ -535,7 +535,7 @@ public GroupByYearAction()
535535
context.PropertyChanged += Context_PropertyChanged;
536536
}
537537

538-
public Task ExecuteAsync()
538+
public Task ExecuteAsync(object? parameter = null)
539539
{
540540
context.GroupByDateUnit = GroupByDateUnit.Year;
541541

@@ -579,7 +579,7 @@ public GroupByMonthAction()
579579
context.PropertyChanged += Context_PropertyChanged;
580580
}
581581

582-
public Task ExecuteAsync()
582+
public Task ExecuteAsync(object? parameter = null)
583583
{
584584
context.GroupByDateUnit = GroupByDateUnit.Month;
585585

@@ -615,7 +615,7 @@ public ToggleGroupByDateUnitAction()
615615
context = Ioc.Default.GetRequiredService<IDisplayPageContext>();
616616
}
617617

618-
public Task ExecuteAsync()
618+
public Task ExecuteAsync(object? parameter = null)
619619
{
620620
context.GroupByDateUnit = context.GroupByDateUnit switch
621621
{

src/Files.App/Actions/Display/LayoutAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public ToggleLayoutAction()
147147
Context.PropertyChanged += Context_PropertyChanged;
148148
}
149149

150-
public Task ExecuteAsync()
150+
public Task ExecuteAsync(object? parameter = null)
151151
{
152152
Context.LayoutType = LayoutType;
153153

@@ -233,7 +233,7 @@ private void UserSettingsService_PropertyChanged(object? sender, PropertyChanged
233233
}
234234
}
235235

236-
public Task ExecuteAsync()
236+
public Task ExecuteAsync(object? parameter = null)
237237
{
238238
switch (DisplayPageContext.LayoutType)
239239
{
@@ -326,7 +326,7 @@ private void UserSettingsService_PropertyChanged(object? sender, PropertyChanged
326326
}
327327
}
328328

329-
public Task ExecuteAsync()
329+
public Task ExecuteAsync(object? parameter = null)
330330
{
331331
switch (DisplayPageContext.LayoutType)
332332
{

src/Files.App/Actions/Display/SortAction.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public SortByAction()
164164
displayContext.PropertyChanged += DisplayContext_PropertyChanged;
165165
}
166166

167-
public Task ExecuteAsync()
167+
public Task ExecuteAsync(object? parameter = null)
168168
{
169169
displayContext.SortOption = SortOption;
170170

@@ -206,7 +206,7 @@ public SortAscendingAction()
206206
context.PropertyChanged += Context_PropertyChanged;
207207
}
208208

209-
public Task ExecuteAsync()
209+
public Task ExecuteAsync(object? parameter = null)
210210
{
211211
context.SortDirection = SortDirection.Ascending;
212212

@@ -240,7 +240,7 @@ public SortDescendingAction()
240240
context.PropertyChanged += Context_PropertyChanged;
241241
}
242242

243-
public Task ExecuteAsync()
243+
public Task ExecuteAsync(object? parameter = null)
244244
{
245245
context.SortDirection = SortDirection.Descending;
246246

@@ -269,7 +269,7 @@ public ToggleSortDirectionAction()
269269
context = Ioc.Default.GetRequiredService<IDisplayPageContext>();
270270
}
271271

272-
public Task ExecuteAsync()
272+
public Task ExecuteAsync(object? parameter = null)
273273
{
274274
context.SortDirection =
275275
context.SortDirection is SortDirection.Descending

0 commit comments

Comments
 (0)