38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Microsoft.Advertising.WinRT.UI;
|
|
using System;
|
|
using Windows.ApplicationModel.Core;
|
|
|
|
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();
|
|
}
|
|
|
|
public static NativeAdsManagerV2 AdManager => new NativeAdsManagerV2("9ncqqxjtdlfh", "1100044398");
|
|
}
|
|
}
|