From 70d062ba39e618d5084720324d5996e2609465d7 Mon Sep 17 00:00:00 2001 From: danwalmsley Date: Thu, 10 Sep 2020 16:26:47 +0100 Subject: [PATCH 1/4] make code more readable. --- src/Avalonia.OpenGL/Angle/AngleEglInterface.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs b/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs index 375b93c27c..3ec6ba1772 100644 --- a/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs +++ b/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs @@ -18,11 +18,18 @@ namespace Avalonia.OpenGL.Angle static Func LoadAngle() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { throw new PlatformNotSupportedException(); + } + else { var disp = eglGetProcAddress("eglGetPlatformDisplayEXT"); + if (disp == IntPtr.Zero) + { throw new OpenGlException("libegl.dll doesn't have eglGetPlatformDisplayEXT entry point"); + } + return eglGetProcAddress; } } From c48c82f171ecb4658e10474636505216547c5ec3 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 10 Sep 2020 17:17:23 +0100 Subject: [PATCH 2/4] formatting. --- src/Avalonia.OpenGL/Angle/AngleEglInterface.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs b/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs index 3ec6ba1772..8565d99b45 100644 --- a/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs +++ b/src/Avalonia.OpenGL/Angle/AngleEglInterface.cs @@ -17,21 +17,19 @@ namespace Avalonia.OpenGL.Angle static Func LoadAngle() { - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - throw new PlatformNotSupportedException(); - } - else + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var disp = eglGetProcAddress("eglGetPlatformDisplayEXT"); - + if (disp == IntPtr.Zero) { throw new OpenGlException("libegl.dll doesn't have eglGetPlatformDisplayEXT entry point"); } - + return eglGetProcAddress; } + + throw new PlatformNotSupportedException(); } } From 12f0fc046a892922c6c2b683c467a5a95f720931 Mon Sep 17 00:00:00 2001 From: Rustam Sayfutdinov Date: Sat, 12 Sep 2020 11:47:12 +0500 Subject: [PATCH 3/4] Update Microsoft.NETFramework.ReferenceAssemblies --- build/NetFX.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NetFX.props b/build/NetFX.props index ed5cb6dd69..8ffc9ec561 100644 --- a/build/NetFX.props +++ b/build/NetFX.props @@ -1,7 +1,7 @@  - + From e1045a09c9a173450afe5c241d583134336cef8d Mon Sep 17 00:00:00 2001 From: Rustam Sayfutdinov Date: Sun, 13 Sep 2020 21:30:19 +0500 Subject: [PATCH 4/4] Improve for the backend web preview --- .../Remote/HtmlTransport/HtmlTransport.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/HtmlTransport.cs b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/HtmlTransport.cs index 55e2df8890..03dcf85b87 100644 --- a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/HtmlTransport.cs +++ b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/HtmlTransport.cs @@ -38,11 +38,13 @@ namespace Avalonia.DesignerSupport.Remote.HtmlTransport public HtmlWebSocketTransport(IAvaloniaRemoteTransportConnection signalTransport, Uri listenUri) { if (listenUri.Scheme != "http") - throw new ArgumentException("listenUri"); + throw new ArgumentException("URI scheme is not HTTP.", nameof(listenUri)); var resourcePrefix = "Avalonia.DesignerSupport.Remote.HtmlTransport.webapp.build."; _resources = typeof(HtmlWebSocketTransport).Assembly.GetManifestResourceNames() - .Where(r => r.StartsWith(resourcePrefix) && r.EndsWith(".gz")).ToDictionary( + .Where(r => r.StartsWith(resourcePrefix, StringComparison.OrdinalIgnoreCase) + && r.EndsWith(".gz", StringComparison.OrdinalIgnoreCase)) + .ToDictionary( r => r.Substring(resourcePrefix.Length).Substring(0,r.Length-resourcePrefix.Length-3), r => {