/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs
54 строки
1 KB
yair100
Code Quality: Update strings for shortcut actions (#18402)
21 апр 2026, 19:28
Не верифицирован
21 апр 2026, 19:28
36c8698
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Actions { [GeneratedRichCommand] internal sealed partial class CreateShortcutFromDialogAction : BaseUIAction, IAction { private readonly IContentPageContext context; public string Label => Strings.Shortcut.GetLocalizedResource(); public string ExtendedLabel => Strings.CreateShortcut.GetLocalizedResource(); public string Description => Strings.CreateShortcutFromDialogDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.Create; public string AccessKey => "S"; public string AutomationId => "InnerNavigationToolbarNewShortcutButton"; public RichGlyph Glyph => new("\uE71B"); public override bool IsExecutable => context.CanCreateItem && UIHelpers.CanShowDialog; public CreateShortcutFromDialogAction() { context = Ioc.Default.GetRequiredService<IContentPageContext>(); context.PropertyChanged += Context_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) { return UIFilesystemHelpers.CreateShortcutFromDialogAsync(context.ShellPage!); } private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(IContentPageContext.CanCreateItem)) OnPropertyChanged(nameof(IsExecutable)); } } }