|
|
@ -37,12 +37,15 @@ namespace Avalonia |
|
|
/// <returns>An <see cref="AppBuilder"/> instance.</returns>
|
|
|
/// <returns>An <see cref="AppBuilder"/> instance.</returns>
|
|
|
public AppBuilder UsePlatformDetect() |
|
|
public AppBuilder UsePlatformDetect() |
|
|
{ |
|
|
{ |
|
|
|
|
|
var os = RuntimePlatform.GetRuntimeInfo().OperatingSystem; |
|
|
//We don't have the ability to load every assembly right now, so we are
|
|
|
//We don't have the ability to load every assembly right now, so we are
|
|
|
//stuck with manual configuration here
|
|
|
//stuck with manual configuration here
|
|
|
//Helpers are extracted to separate methods to take the advantage of the fact
|
|
|
//Helpers are extracted to separate methods to take the advantage of the fact
|
|
|
//that CLR doesn't try to load dependencies before referencing method is jitted
|
|
|
//that CLR doesn't try to load dependencies before referencing method is jitted
|
|
|
if (RuntimePlatform.GetRuntimeInfo().OperatingSystem == OperatingSystemType.WinNT) |
|
|
if (os == OperatingSystemType.WinNT) |
|
|
LoadWin32(); |
|
|
LoadWin32(); |
|
|
|
|
|
else if(os==OperatingSystemType.OSX) |
|
|
|
|
|
LoadMonoMac(); |
|
|
else |
|
|
else |
|
|
LoadGtk3(); |
|
|
LoadGtk3(); |
|
|
this.UseSkia(); |
|
|
this.UseSkia(); |
|
|
@ -50,6 +53,7 @@ namespace Avalonia |
|
|
return this; |
|
|
return this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LoadMonoMac() => this.UseMonoMac(); |
|
|
void LoadWin32() => this.UseWin32(); |
|
|
void LoadWin32() => this.UseWin32(); |
|
|
void LoadGtk3() => this.UseGtk3(); |
|
|
void LoadGtk3() => this.UseGtk3(); |
|
|
} |
|
|
} |
|
|
|