9 changed files with 37 additions and 71 deletions
@ -1,26 +1,20 @@ |
|||||
using System; |
using System; |
||||
using System.Threading; |
using System.Threading; |
||||
using Avalonia.Compatibility; |
using Avalonia.Compatibility; |
||||
|
using Avalonia.Metadata; |
||||
using Avalonia.Platform.Internal; |
using Avalonia.Platform.Internal; |
||||
|
|
||||
namespace Avalonia.Platform |
namespace Avalonia.Platform |
||||
{ |
{ |
||||
|
[PrivateApi] |
||||
public class StandardRuntimePlatform : IRuntimePlatform |
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() |
private static readonly RuntimePlatformInfo s_info = new() |
||||
{ |
{ |
||||
IsDesktop = OperatingSystemEx.IsWindows() || OperatingSystemEx.IsMacOS() || OperatingSystemEx.IsLinux(), |
IsDesktop = OperatingSystemEx.IsWindows() || OperatingSystemEx.IsMacOS() || OperatingSystemEx.IsLinux(), |
||||
IsMobile = OperatingSystemEx.IsAndroid() || OperatingSystemEx.IsIOS() |
IsMobile = OperatingSystemEx.IsAndroid() || OperatingSystemEx.IsIOS() |
||||
}; |
}; |
||||
|
|
||||
|
|
||||
public virtual RuntimePlatformInfo GetRuntimeInfo() => s_info; |
public virtual RuntimePlatformInfo GetRuntimeInfo() => s_info; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue