/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Content/Selection/SelectAllAction.cs
60 строк
1 KB
yair100
Code Quality: Add Category, ExtendedLabel, AutomationId and AccessKey to actions (#18308)
27 мар 2026, 00:40
Не верифицирован
27 мар 2026, 00:40
6ef1f17
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Actions { [GeneratedRichCommand] internal sealed class SelectAllAction : IAction { private readonly IContentPageContext context; public string Label => Strings.SelectAll.GetLocalizedResource(); public string Description => Strings.SelectAllDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.Selection; public RichGlyph Glyph => new(themedIconStyle: "App.ThemedIcons.SelectAll"); public HotKey HotKey => new(Keys.A, KeyModifiers.Ctrl); public bool IsExecutable { get { if (context.PageType is ContentPageTypes.Home) return false; var page = context.ShellPage; if (page is null) return false; int itemCount = page.ShellViewModel.FilesAndFolders.Count; int selectedItemCount = context.SelectedItems.Count; if (itemCount == selectedItemCount) return false; bool isRenaming = page.SlimContentPage?.IsRenamingItem ?? false; return !isRenaming; } } public SelectAllAction() { context = Ioc.Default.GetRequiredService<IContentPageContext>(); } public Task ExecuteAsync(object? parameter = null) { context.ShellPage?.SlimContentPage?.ItemManipulationModel?.SelectAllItems(); return Task.CompletedTask; } } }