Anyway, I am the only one who reads this, right?
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using Windows.ApplicationModel.Core;
|
||||
using Windows.UI.Notifications;
|
||||
|
||||
namespace FoxTube.Core.Helpers
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Terminates current application session
|
||||
/// </summary>
|
||||
public static void CloseApp() =>
|
||||
CoreApplication.Exit();
|
||||
|
||||
/// <summary>
|
||||
/// Restarts application
|
||||
/// </summary>
|
||||
public static void RestartApp() =>
|
||||
RestartApp(null);
|
||||
|
||||
/// <summary>
|
||||
/// Restarts application with specified parameters
|
||||
/// </summary>
|
||||
/// <param name="args">Parameters which will be provided to new application instance</param>
|
||||
public static async void RestartApp(string args) =>
|
||||
await CoreApplication.RequestRestartAsync(args);
|
||||
|
||||
public static void InitializeFailsafeProtocol()
|
||||
{
|
||||
Metrics.AddEvent("Failsafe protocol initiated");
|
||||
Settings.ResetSettings();
|
||||
RestartApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user