9 changed files with 37 additions and 71 deletions
@ -1,26 +1,20 @@ |
|||
using System; |
|||
using System.Threading; |
|||
using Avalonia.Compatibility; |
|||
using Avalonia.Metadata; |
|||
using Avalonia.Platform.Internal; |
|||
|
|||
namespace Avalonia.Platform |
|||
{ |
|||
[PrivateApi] |
|||
public class StandardRuntimePlatform : IRuntimePlatform |
|||
{ |
|||
public IDisposable StartSystemTimer(TimeSpan interval, Action tick) |
|||
{ |
|||
return new Timer(_ => tick(), null, interval, interval); |
|||
} |
|||
|
|||
public IUnmanagedBlob AllocBlob(int size) => new UnmanagedBlob(size); |
|||
|
|||
private static readonly RuntimePlatformInfo s_info = new() |
|||
{ |
|||
IsDesktop = OperatingSystemEx.IsWindows() || OperatingSystemEx.IsMacOS() || OperatingSystemEx.IsLinux(), |
|||
IsMobile = OperatingSystemEx.IsAndroid() || OperatingSystemEx.IsIOS() |
|||
}; |
|||
|
|||
|
|||
|
|||
public virtual RuntimePlatformInfo GetRuntimeInfo() => s_info; |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue