forked from amkovkov/GranuSightSoftware2
feat: command line debug option
This commit is contained in:
+15
-1
@@ -22,11 +22,25 @@ public partial class Program
|
||||
private static void Ui(ParseResult parseResult)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
var fullscreen = parseResult.GetValue(_fullscreen);
|
||||
var debug = parseResult.GetValue(_debug);
|
||||
var renderingMode = parseResult.GetValue(_renderingMode);
|
||||
var hideConsole = parseResult.GetValue(_hideConsole);
|
||||
var fullscreen = parseResult.GetValue(_fullscreen);
|
||||
|
||||
IsFullscreen = fullscreen;
|
||||
|
||||
#if DEBUG
|
||||
if (debug && !System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
Console.WriteLine("Waiting debugger attach");
|
||||
Console.WriteLine($"ProcessId: {Environment.ProcessPath} [{Environment.ProcessId}]");
|
||||
Console.WriteLine($"Thread: {Thread.CurrentThread.Name} [{Thread.CurrentThread.ManagedThreadId}]");
|
||||
while (!System.Diagnostics.Debugger.IsAttached)
|
||||
Thread.Sleep(100);
|
||||
System.Diagnostics.Debugger.Break();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hideConsole)
|
||||
SilenceConsole();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user