Exemple #1
0
 public void SetCloseCallback(ULCloseCallback callback, IntPtr userData = default)
 {
     if (callback is not null)
     {
         ULCloseCallback__PInvoke__ callback__PInvoke__ = (user_data, window) => callback(user_data, new ULWindow(window));
         if (handles[0].IsAllocated)
         {
             handles[0].Free();
         }
         handles[0] = GCHandle.Alloc(callback__PInvoke__, GCHandleType.Normal);
         AppCoreMethods.ulWindowSetCloseCallback(Ptr, callback__PInvoke__, userData);
     }
     else
     {
         if (handles[0].IsAllocated)
         {
             handles[0].Free();
         }
         handles[0] = default;
         AppCoreMethods.ulWindowSetCloseCallback(Ptr, null, userData);
     }
 }
Exemple #2
0
 internal static extern void ulWindowSetCloseCallback(IntPtr window, ULCloseCallback callback, IntPtr user_data);
Exemple #3
0
 public static extern void ulWindowSetCloseCallback(ULWindow window, ULCloseCallback callback, IntPtr user_data);