-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathProgram.cs
More file actions
49 lines (43 loc) · 1.44 KB
/
Copy pathProgram.cs
File metadata and controls
49 lines (43 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using Avalonia;
namespace Autodraw;
internal class Program
{
private static bool compatability = false;
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args)
{
try
{
compatability = args?.Length > 0 && args[0].Equals("compat", StringComparison.OrdinalIgnoreCase);
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}
catch (Exception e)
{
Utils.Log(e.ToString());
Utils.Log(e.Message);
throw;
}
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
{
var app = AppBuilder.Configure<App>()
.UsePlatformDetect();
if (compatability)
{
app = app.With(new Win32PlatformOptions
{
RenderingMode = [Win32RenderingMode.Wgl,Win32RenderingMode.Vulkan,Win32RenderingMode.Software],
CompositionMode = [Win32CompositionMode.WinUIComposition,Win32CompositionMode.DirectComposition,Win32CompositionMode.RedirectionSurface]
});
}
app.WithInterFont()
.LogToTrace();
return app;
}
}