Project Maintenance

This commit is contained in:
Gustave Monce
2021-08-09 20:21:09 +02:00
parent 9865ef7f79
commit 847ce0506d
411 changed files with 5922 additions and 54941 deletions
+13 -12
View File
@@ -35,7 +35,7 @@ namespace WPinternals
internal static Action NavigateToUnlockBoot;
internal static PatchEngine PatchEngine;
internal static WPinternalsConfig Config;
internal static Mutex mutex = new Mutex(false, "Global\\WPinternalsRunning");
internal static Mutex mutex = new(false, "Global\\WPinternalsRunning");
internal static DownloadsViewModel DownloadManager;
internal static bool InterruptBoot = false;
internal static bool IsPnPEventLogMissing = true;
@@ -49,24 +49,29 @@ namespace WPinternals
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
#endif
if (Environment.GetCommandLineArgs().Count() > 1)
if (Environment.GetCommandLineArgs().Length > 1)
{
CommandLine.OpenConsole();
}
try
{
if (!mutex.WaitOne(0, false))
{
if (Environment.GetCommandLineArgs().Count() > 1)
if (Environment.GetCommandLineArgs().Length > 1)
{
Console.WriteLine("Windows Phone Internals is already running");
CommandLine.CloseConsole();
}
else
{
MessageBox.Show("Windows Phone Internals is already running.", "Windows Phone Internals", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
Environment.Exit(0);
}
}
catch (AbandonedMutexException) { };
catch (AbandonedMutexException) { }
Registration.CheckExpiration();
@@ -78,20 +83,16 @@ namespace WPinternals
}
else
{
using (Stream stream = System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("WPinternals.PatchDefinitions.xml"))
{
using (StreamReader sr = new StreamReader(stream))
{
PatchDefintionsXml = sr.ReadToEnd();
}
}
using Stream stream = System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("WPinternals.PatchDefinitions.xml");
using StreamReader sr = new(stream);
PatchDefintionsXml = sr.ReadToEnd();
}
PatchEngine = new PatchEngine(PatchDefintionsXml);
Config = WPinternalsConfig.ReadConfig();
}
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
if (e.ExceptionObject is Exception)
{