AI Pettorali
This commit is contained in:
parent
25fdb82d2f
commit
cb41c42bb5
11 changed files with 379 additions and 55 deletions
|
|
@ -38,6 +38,8 @@ static class Program
|
|||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
static extern bool AttachConsole(int dwProcessId);
|
||||
|
||||
private const int ATTACH_PARENT_PROCESS = -1;
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool GenerateConsoleCtrlEvent(uint dwCtrlEvent, uint dwProcessGroupId);
|
||||
|
||||
|
|
@ -85,10 +87,18 @@ static class Program
|
|||
.LogToTrace();
|
||||
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
static int Main(string[] args)
|
||||
{
|
||||
#if WINDOWS
|
||||
AllocConsole();
|
||||
if (CommandLineOperationRunner.IsHeadlessRequest(args))
|
||||
{
|
||||
AttachConsole(ATTACH_PARENT_PROCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
AllocConsole();
|
||||
}
|
||||
|
||||
RedirectConsoleOutput();
|
||||
#endif
|
||||
|
||||
|
|
@ -97,7 +107,15 @@ static class Program
|
|||
|
||||
ServiceProvider = serviceCollection.BuildServiceProvider();
|
||||
|
||||
if (CommandLineOperationRunner.IsHeadlessRequest(args))
|
||||
{
|
||||
return CommandLineOperationRunner.RunAsync(ServiceProvider, args ?? Array.Empty<string>())
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
|
||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args ?? Array.Empty<string>());
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void ConfigureServices(ServiceCollection services)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue