2 changed files with 14 additions and 12 deletions
@ -1,20 +1,18 @@ |
|||||
using System; |
|
||||
using System.Threading; |
|
||||
using Avalonia.Compatibility; |
using Avalonia.Compatibility; |
||||
using Avalonia.Metadata; |
using Avalonia.Metadata; |
||||
using Avalonia.Platform.Internal; |
|
||||
|
|
||||
namespace Avalonia.Platform |
namespace Avalonia.Platform |
||||
{ |
{ |
||||
[PrivateApi] |
[PrivateApi] |
||||
public class StandardRuntimePlatform : IRuntimePlatform |
public class StandardRuntimePlatform : IRuntimePlatform |
||||
{ |
{ |
||||
private static readonly RuntimePlatformInfo s_info = new() |
public virtual RuntimePlatformInfo GetRuntimeInfo() => new() |
||||
{ |
{ |
||||
IsDesktop = OperatingSystemEx.IsWindows() || OperatingSystemEx.IsMacOS() || OperatingSystemEx.IsLinux(), |
IsDesktop = OperatingSystemEx.IsWindows() |
||||
IsMobile = OperatingSystemEx.IsAndroid() || OperatingSystemEx.IsIOS() |
|| OperatingSystemEx.IsMacOS() || OperatingSystemEx.IsMacCatalyst() |
||||
|
|| OperatingSystemEx.IsLinux() || OperatingSystemEx.IsFreeBSD(), |
||||
|
IsMobile = OperatingSystemEx.IsAndroid() || (OperatingSystemEx.IsIOS() && !OperatingSystemEx.IsMacCatalyst()), |
||||
|
IsTV = OperatingSystemEx.IsTvOS() |
||||
}; |
}; |
||||
|
|
||||
public virtual RuntimePlatformInfo GetRuntimeInfo() => s_info; |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue