/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Helpers/Application/AppToastNotificationHelper.cs
39 строк
1 KB
Yair
Code Quality: Ran code cleanup (#17307)
25 июл 2025, 03:57
Не верифицирован
25 июл 2025, 03:57
4558bc2
Код
Авторство
О чём код?
using Microsoft.Windows.AppNotifications; using Microsoft.Windows.AppNotifications.Builder; namespace Files.App.Helpers.Application { internal static class AppToastNotificationHelper { public static void ShowUnhandledExceptionToast() { var toastContent = new AppNotificationBuilder() .AddText(Strings.ExceptionNotificationHeader.GetLocalizedResource()) .AddText(Strings.ExceptionNotificationBody.GetLocalizedResource()) .SetAppLogoOverride(new Uri("ms-appx:///Assets/error.png")) .AddButton(new AppNotificationButton(Strings.ExceptionNotificationReportButton.GetLocalizedResource()) .SetInvokeUri(new Uri(Constants.ExternalUrl.BugReportUrl))) .BuildNotification(); AppNotificationManager.Default.Show(toastContent); } public static void ShowBackgroundRunningToast() { var toastContent = new AppNotificationBuilder() .AddText(Strings.BackgroundRunningNotificationHeader.GetLocalizedResource()) .AddText(Strings.BackgroundRunningNotificationBody.GetLocalizedResource()) .BuildNotification(); AppNotificationManager.Default.Show(toastContent); } public static void ShowDriveEjectToast() { var toastContent = new AppNotificationBuilder() .AddText(Strings.EjectNotificationHeader.GetLocalizedResource()) .AddText(Strings.EjectNotificationBody.GetLocalizedResource()) .SetAttributionText("SettingsAboutAppName".GetLocalizedResource()) .BuildNotification(); AppNotificationManager.Default.Show(toastContent); } } }