/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Open/OpenStorageSenseFromSidebarAction.cs
29 строк
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 OpenStorageSenseFromSidebarAction : OpenStorageSenseAction { private ISidebarContext SidebarContext { get; } = Ioc.Default.GetRequiredService<ISidebarContext>(); private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService<DrivesViewModel>(); public override bool IsExecutable => SidebarContext.IsItemRightClicked && SidebarContext.RightClickedItem is not null && SidebarContext.RightClickedItem.Path is not null && drivesViewModel.Drives .Cast<DriveItem>() .FirstOrDefault(x => string.Equals(x.Path, SidebarContext.RightClickedItem.Path)) is DriveItem driveItem && driveItem.Type != DriveType.Network; public override bool IsAccessibleGlobally => false; public override Task ExecuteAsync(object? parameter = null) { return StorageSenseHelper.OpenStorageSenseAsync(SidebarContext?.RightClickedItem?.Path ?? string.Empty); } } }