/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Navigation/CloseTabsToTheRightSelectedAction.cs
43 строки
1 KB
0x5BFA
Code Quality: Generate ICommandManager, CommandManager and CommandCodes from [GeneratedRichCommand] (#17536)
04 сен 2025, 17:35
Не верифицирован
04 сен 2025, 17:35
d45ca74
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Actions { [GeneratedRichCommand] internal sealed partial class CloseTabsToTheRightSelectedAction : CloseTabBaseAction { public override string Label => Strings.CloseTabsToTheRight.GetLocalizedResource(); public override string Description => Strings.CloseTabsToTheRightSelectedDescription.GetLocalizedResource(); public CloseTabsToTheRightSelectedAction() { } public override Task ExecuteAsync(object? parameter = null) { MultitaskingTabsHelpers.CloseTabsToTheRight(context.SelectedTabItem, context.Control!); return Task.CompletedTask; } protected override bool GetIsExecutable() { return context.Control is not null && context.SelectedTabIndex < context.TabCount - 1; } protected override void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case nameof(IMultitaskingContext.Control): case nameof(IMultitaskingContext.TabCount): case nameof(IMultitaskingContext.SelectedTabIndex): OnPropertyChanged(nameof(IsExecutable)); break; } } } }