mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-19 13:50:11 +10:00
Project Maintenance
This commit is contained in:
+13
-12
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user