diff --git a/.gitignore b/.gitignore index 3405b55..cf2da71 100644 --- a/.gitignore +++ b/.gitignore @@ -263,6 +263,3 @@ __pycache__/ /Installer/Output/JWLMergePortable.zip /Installer/Output/JWLMergePortable /Installer/Staging - -# AppCenter -JWLMerge/AppCenterInit.cs \ No newline at end of file diff --git a/JWLMerge/AppCenterInit.cs b/JWLMerge/AppCenterInit.cs new file mode 100644 index 0000000..c7a4257 --- /dev/null +++ b/JWLMerge/AppCenterInit.cs @@ -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} + } +}