Remove AppCenter and ControlzEx

This commit is contained in:
Yoshi Askharoun
2024-05-15 00:54:41 -05:00
parent 72a0d78feb
commit 26b6ed6c70
3 changed files with 1 additions and 46 deletions
-13
View File
@@ -1,8 +1,5 @@
using System.Windows;
using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Microsoft.Extensions.DependencyInjection;
namespace ZuneModdingHelper
@@ -24,16 +21,6 @@ namespace ZuneModdingHelper
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Set up App Center analytics
AppCenter.SetCountryCode(System.Globalization.RegionInfo.CurrentRegion.TwoLetterISORegionName);
AppCenter.Start("24903c19-b3d9-4ab5-b445-b981ca647125", typeof(Analytics), typeof(Crashes));
#if DEBUG
// Disable crash and event analytics when in debug
AppCenter.SetEnabledAsync(false);
#endif
ConfigureServices();
}
-30
View File
@@ -2,13 +2,11 @@
using ControlzEx.Theming;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using Microsoft.AppCenter.Analytics;
using Microsoft.WindowsAPICodePack.Dialogs;
using Octokit;
using OwlCore.AbstractUI.Models;
using Syroot.Windows.IO;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -99,11 +97,6 @@ namespace ZuneModdingHelper
string applyResult = await mod.Apply();
if (applyResult != null)
{
Analytics.TrackEvent("Failed to apply mod", new Dictionary<string, string> {
{ "ModID", mod.Id },
{ "ErrorMessage", applyResult }
});
await progDialog.CloseAsync();
await this.ShowMessageAsync($"Failed to apply '{mod.Title}'", applyResult, settings: defaultMetroDialogSettings);
@@ -111,10 +104,6 @@ namespace ZuneModdingHelper
}
progDialog.SetProgress(++numCompleted);
Analytics.TrackEvent("Applied mod", new Dictionary<string, string> {
{ "ModID", mod.Id },
});
await progDialog.CloseAsync();
await this.ShowMessageAsync("Completed", $"Installed '{mod.Title}'", settings: defaultMetroDialogSettings);
}
@@ -146,11 +135,6 @@ namespace ZuneModdingHelper
string resetResult = await mod.Reset();
if (resetResult != null)
{
Analytics.TrackEvent("Failed to reset mod", new Dictionary<string, string> {
{ "ModID", mod.Id },
{ "ErrorMessage", resetResult }
});
await progDialog.CloseAsync();
await this.ShowMessageAsync("Completed", $"Failed to reset '{mod.Title}':\r\n{resetResult}", settings: defaultMetroDialogSettings);
return;
@@ -158,10 +142,6 @@ namespace ZuneModdingHelper
progDialog.SetProgress(++numCompleted);
Analytics.TrackEvent("Reset mod", new Dictionary<string, string> {
{ "ModID", mod.Id },
});
await progDialog.CloseAsync();
await this.ShowMessageAsync("Completed", $"Successfully reset '{mod.Title}'", settings: defaultMetroDialogSettings);
}
@@ -200,11 +180,6 @@ namespace ZuneModdingHelper
if (!ReleaseVersion.TryParse(latest.Release.TagName, out var latestVer) || App.Version >= latestVer)
{
// Already up-to-date
Analytics.TrackEvent("Checked for updates", new Dictionary<string, string> {
{ "UpdatesFound", bool.FalseString },
});
await checkDialog.CloseAsync();
await this.ShowMessageAsync("No updates available", "You're already using the latest version.", settings: defaultMetroDialogSettings);
return;
@@ -261,11 +236,6 @@ namespace ZuneModdingHelper
File.Delete(downloadedFile);
}
Analytics.TrackEvent("Checked for updates", new Dictionary<string, string> {
{ "UpdatesFound", bool.TrueString },
{ "Accepted", acceptedUpdate.ToString() },
});
}
catch
{
+1 -3
View File
@@ -21,10 +21,7 @@
<ItemGroup>
<PackageReference Include="Colourful" Version="3.2.0" />
<PackageReference Include="ControlzEx" Version="6.0.0" />
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="Octokit" Version="11.0.1" />
<PackageReference Include="OwlCore" Version="0.4.1" />
@@ -33,6 +30,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\Candystripe.png" />
<Resource Include="Assets\ZMH_Icons.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>