/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Content/Selection/ClearSelectionAction.cs
55 строк
1 KB
yair100
Feature: Added support for searching settings (#18429)
29 апр 2026, 02:14
Не верифицирован
29 апр 2026, 02:14
edbc016
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Actions { [GeneratedRichCommand] internal sealed class ClearSelectionAction : IAction { private readonly IContentPageContext context; public string Label => Strings.ClearSelection.GetLocalizedResource(); public string Description => Strings.ClearSelectionDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.Selection; public RichGlyph Glyph => new(themedIconStyle: "App.ThemedIcons.SelectNone"); public bool IsExecutable { get { if (context.PageType is ContentPageTypes.Home) return false; if (!context.HasSelection) return false; var page = context.ShellPage; if (page is null) return false; bool isRenaming = page.SlimContentPage?.IsRenamingItem ?? false; return !isRenaming; } } public ClearSelectionAction() { context = Ioc.Default.GetRequiredService<IContentPageContext>(); } public Task ExecuteAsync(object? parameter = null) { context.ShellPage?.SlimContentPage?.ItemManipulationModel?.ClearSelection(); return Task.CompletedTask; } } }