app center

This commit is contained in:
AntonyCorbett
2022-01-07 16:33:24 +00:00
parent 67c96ff000
commit c85f031866
2 changed files with 25 additions and 3 deletions

3
.gitignore vendored
View File

@@ -263,6 +263,3 @@ __pycache__/
/Installer/Output/JWLMergePortable.zip
/Installer/Output/JWLMergePortable
/Installer/Staging
# AppCenter
JWLMerge/AppCenterInit.cs

25
JWLMerge/AppCenterInit.cs Normal file
View File

@@ -0,0 +1,25 @@
using System.Globalization;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
namespace JWLMerge
{
internal static class AppCenterInit
{
private static readonly string? TheToken = null;
#pragma warning disable U2U1112 // Do not call string.IsNullOrEmpty() on a constant string
#pragma warning disable CA1416 // Validate platform compatibility
public static void Execute()
{
if (!string.IsNullOrEmpty(TheToken))
{
AppCenter.Start(TheToken, typeof(Analytics), typeof(Crashes));
AppCenter.SetCountryCode(RegionInfo.CurrentRegion.TwoLetterISORegionName);
}
}
#pragma warning restore CA1416 // Validate platform compatibility
#pragma warning restore U2U1112 // Do not call string.IsNullOrEmpty() on a constant string}
}
}