Example #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);
     }
 }
Example #2
0
 public ULOverlay(ULWindow window, View view, int x = 0, int y = 0)
 {
     Ptr = AppCoreMethods.ulCreateOverlayWithView(window.Ptr, view.Ptr, x, y);
 }
Example #3
0
 public ULOverlay(ULWindow window, uint width, uint height, int x = 0, int y = 0)
 {
     Ptr = AppCoreMethods.ulCreateOverlay(window.Ptr, width, height, x, y);
 }
Example #4
0
 public ULWindow(ULMonitor monitor, uint width, uint height, bool fullscreen, ULWindowFlags flags)
 {
     Ptr = AppCoreMethods.ulCreateWindow(monitor.Ptr, width, height, fullscreen, flags);
 }
Example #5
0
 public void MoveToCenter() => AppCoreMethods.ulWindowMoveToCenter(Ptr);
Example #6
0
 public void MoveTo(int x, int y) => AppCoreMethods.ulWindowMoveTo(Ptr, x, y);
Example #7
0
 public ULSettings(bool dispose = true)
 {
     IsDisposed = !dispose;
     Ptr        = AppCoreMethods.ulCreateSettings();
 }