]> O.S.I.I.S - jp/crow.git/commitdiff
add netcore NativeResolve for PerfTests
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 17 Jan 2021 14:40:15 +0000 (15:40 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 17 Jan 2021 14:40:15 +0000 (15:40 +0100)
Samples/PerfTests/Program.cs
Samples/common/ui/Interfaces/Divers/2.crow

index 73b9744845eef569dfe3c474b64913d9b188d82c..a50003f65726b01004a5f7faa31020b06cfaef11 100644 (file)
@@ -6,11 +6,31 @@ using System.CodeDom.Compiler;
 using System.Diagnostics;
 using System.IO;
 using Crow;
+using System.Reflection;
+using System.Runtime.InteropServices;
 
 namespace PerfTests
 {
        class TestInterface : Interface
        {
+#if NETCOREAPP         
+               static IntPtr resolveUnmanaged (Assembly assembly, String libraryName) {
+                       
+                       switch (libraryName)
+                       {
+                               case "glfw3":
+                                       return  NativeLibrary.Load("glfw", assembly, null);
+                               case "rsvg-2.40":
+                                       return  NativeLibrary.Load("rsvg-2", assembly, null);
+                       }
+                       Console.WriteLine ($"[UNRESOLVE] {assembly} {libraryName}");                    
+                       return IntPtr.Zero;
+               }
+
+               static TestInterface () {
+                       System.Runtime.Loader.AssemblyLoadContext.Default.ResolvingUnmanagedDll+=resolveUnmanaged;
+               }
+#endif         
                readonly int count = 1, updateCycles = 0;
                readonly bool miliseconds = false;
                readonly bool resetItors = false;
index d2c8c37067864a4d75f6f97154332872b1802e61..a1896248dc2f1b31dc479bb54ca1b2e277c71665 100644 (file)
@@ -2,13 +2,8 @@
 <VerticalStack Fit="true">
        <TextBox Font="droid, 20" Text="test text box" Width="Stretched"/>
        <HorizontalStack Margin="5" Fit="true" MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}">
-               <Label Text="left" Width="80" Height="30" Background="DarkBlue" TextAlignment="Left"/>
-               <Label Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/>
-               <Label Text="top left" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopLeft"/>
-               <Label Text="top right" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopRight"/>
-               <Label Text="right" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/>
-               <Label Text="bottom left" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomLeft"/>
-               <Label Text="bottom" Width="80" Height="30" Background="DarkBlue" TextAlignment="Bottom"/>
-               <Label Text="bottom right" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomRight"/>
+               <Label Focusable="true" Text="left" Width="80" Height="30" Background="DarkBlue" TextAlignment="Left"/>
+               <Label Focusable="true" Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/>
+               <Label Focusable="true" Text="right" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/>
        </HorizontalStack>
 </VerticalStack>
\ No newline at end of file