From 7c77b3ee915a89880dd13a3300be4028bc89a65b Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sat, 27 Jun 2020 11:53:10 +0200 Subject: [PATCH 1/3] Update ncrunch ignore rules. --- .ncrunch/NativeEmbedSample.v3.ncrunchproject | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .ncrunch/NativeEmbedSample.v3.ncrunchproject diff --git a/.ncrunch/NativeEmbedSample.v3.ncrunchproject b/.ncrunch/NativeEmbedSample.v3.ncrunchproject new file mode 100644 index 0000000000..319cd523ce --- /dev/null +++ b/.ncrunch/NativeEmbedSample.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file From cc2ddce5abc52413fcf6d7149abd2394d8dacddd Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sat, 27 Jun 2020 19:59:20 +0800 Subject: [PATCH 2/3] Fix access denied scenario in windows managed dialog --- .../WindowsMountedVolumeInfoListener.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs b/src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs index db4c916052..ba1bfda949 100644 --- a/src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs +++ b/src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs @@ -5,12 +5,13 @@ using System.Linq; using System.Reactive.Disposables; using System.Reactive.Linq; using Avalonia.Controls.Platform; +using Avalonia.Logging; namespace Avalonia.Win32 { internal class WindowsMountedVolumeInfoListener : IDisposable { - private readonly CompositeDisposable _disposables; + private readonly CompositeDisposable _disposables; private bool _beenDisposed = false; private ObservableCollection mountedDrives; @@ -32,10 +33,22 @@ namespace Avalonia.Win32 var allDrives = DriveInfo.GetDrives(); var mountVolInfos = allDrives - .Where(p => p.IsReady) + .Where(p => + { + try + { + var ret = p.IsReady; + return ret; + } + catch (Exception e) + { + Logger.TryGet(LogEventLevel.Warning, LogArea.Control)?.Log(this, $"Error in Windows drive enumeration: {e.Message}"); + } + return false; + }) .Select(p => new MountedVolumeInfo() { - VolumeLabel = string.IsNullOrEmpty(p.VolumeLabel.Trim()) ? p.RootDirectory.FullName + VolumeLabel = string.IsNullOrEmpty(p.VolumeLabel.Trim()) ? p.RootDirectory.FullName : $"{p.VolumeLabel} ({p.Name})", VolumePath = p.RootDirectory.FullName, VolumeSizeBytes = (ulong)p.TotalSize From 3f16bc52545c01f68b179b0553178efe93419242 Mon Sep 17 00:00:00 2001 From: Jumar Macato <16554748+jmacato@users.noreply.github.com> Date: Sat, 27 Jun 2020 20:13:27 +0800 Subject: [PATCH 3/3] Update SplineEasing.cs --- src/Avalonia.Animation/Easing/SplineEasing.cs | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Avalonia.Animation/Easing/SplineEasing.cs b/src/Avalonia.Animation/Easing/SplineEasing.cs index 7192a77531..09b56796c5 100644 --- a/src/Avalonia.Animation/Easing/SplineEasing.cs +++ b/src/Avalonia.Animation/Easing/SplineEasing.cs @@ -8,10 +8,29 @@ namespace Avalonia.Animation.Easings /// public class SplineEasing : Easing { + public SplineEasing() + { + this._internalKeySpline = new KeySpline(); + } + + public SplineEasing(double x1 = 0d, double y1 = 0d, double x2 = 1d, double y2 = 1d) + { + this._internalKeySpline = new KeySpline(); + this.X1 = x1; + this.Y1 = y1; + this.X2 = x2; + this.Y1 = y2; + } + + private KeySpline _internalKeySpline; + private double _x1; + private double _y1; + private double _x2 = 1.0d; + private double _y2 = 1.0d; + /// /// X coordinate of the first control point /// - private double _x1; public double X1 { get => _x1; @@ -24,7 +43,6 @@ namespace Avalonia.Animation.Easings /// /// Y coordinate of the first control point /// - private double _y1; public double Y1 { get => _y1; @@ -37,7 +55,6 @@ namespace Avalonia.Animation.Easings /// /// X coordinate of the second control point /// - private double _x2 = 1.0d; public double X2 { get => _x2; @@ -51,7 +68,6 @@ namespace Avalonia.Animation.Easings /// /// Y coordinate of the second control point /// - private double _y2 = 1.0d; public double Y2 { get => _y2; @@ -61,23 +77,7 @@ namespace Avalonia.Animation.Easings _internalKeySpline.ControlPointY2 = _y2; } } - - private KeySpline _internalKeySpline; - - public SplineEasing(double x1 = 0d, double y1 = 0d, double x2 = 1d, double y2 = 1d) : base() - { - this._internalKeySpline = new KeySpline(); - this.X1 = x1; - this.Y1 = y1; - this.X2 = x2; - this.Y1 = y2; - } - - public SplineEasing() - { - this._internalKeySpline = new KeySpline(); - } - + /// public override double Ease(double progress) => _internalKeySpline.GetSplineProgress(progress);