Dan Walmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
25 additions and
10 deletions
-
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml
-
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml.cs
-
src/Shared/PlatformSupport/StandardRuntimePlatform.cs
|
|
|
@ -79,8 +79,8 @@ |
|
|
|
<DrawingPresenter Drawing="{DynamicResource AvaloniaLogo}" /> |
|
|
|
</Border> |
|
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,-10,0,0"> |
|
|
|
<TextBlock Text="Avalonia 0.9" FontSize="40" Foreground="White" /> |
|
|
|
<TextBlock Text="Development Build" Margin="0,-10,0,0" FontSize="15" Foreground="White" /> |
|
|
|
<TextBlock Text="{Binding Version, StringFormat=Avalonia {0}}" FontSize="40" Foreground="White" /> |
|
|
|
<TextBlock Text="Development Build" IsVisible="{Binding IsDevelopmentBuild}" Margin="0,-10,0,0" FontSize="15" Foreground="White" /> |
|
|
|
</StackPanel> |
|
|
|
</StackPanel> |
|
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Spacing="20" Margin="10 60 10 0"> |
|
|
|
@ -102,4 +102,4 @@ |
|
|
|
<TextBlock Text="© 2020 The Avalonia Project" TextWrapping="Wrap" HorizontalAlignment="Center" /> |
|
|
|
</StackPanel> |
|
|
|
</Grid> |
|
|
|
</Window> |
|
|
|
</Window> |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using Avalonia.Controls; |
|
|
|
@ -7,12 +8,18 @@ namespace Avalonia.Dialogs |
|
|
|
{ |
|
|
|
public class AboutAvaloniaDialog : Window |
|
|
|
{ |
|
|
|
private static readonly Version s_version = typeof(AboutAvaloniaDialog).Assembly.GetName().Version; |
|
|
|
|
|
|
|
public static string Version { get; } = s_version.ToString(2); |
|
|
|
|
|
|
|
public static bool IsDevelopmentBuild { get; } = s_version.Revision == 999; |
|
|
|
|
|
|
|
public AboutAvaloniaDialog() |
|
|
|
{ |
|
|
|
AvaloniaXamlLoader.Load(this); |
|
|
|
DataContext = this; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void OpenBrowser(string url) |
|
|
|
{ |
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
|
|
|
|
|
|
|
@ -49,12 +49,20 @@ namespace Avalonia.Shared.PlatformSupport |
|
|
|
|
|
|
|
public UnmanagedBlob(StandardRuntimePlatform plat, int size) |
|
|
|
{ |
|
|
|
if (size <= 0) |
|
|
|
throw new ArgumentException("Positive number required", nameof(size)); |
|
|
|
_plat = plat; |
|
|
|
_address = plat.Alloc(size); |
|
|
|
GC.AddMemoryPressure(size); |
|
|
|
Size = size; |
|
|
|
try |
|
|
|
{ |
|
|
|
if (size <= 0) |
|
|
|
throw new ArgumentException("Positive number required", nameof(size)); |
|
|
|
_plat = plat; |
|
|
|
_address = plat.Alloc(size); |
|
|
|
GC.AddMemoryPressure(size); |
|
|
|
Size = size; |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
GC.SuppressFinalize(this); |
|
|
|
throw; |
|
|
|
} |
|
|
|
#if DEBUG
|
|
|
|
_backtrace = Environment.StackTrace; |
|
|
|
lock (_btlock) |
|
|
|
|