Exemple #1
0
 void MyDragDrop(UIDragEventArgs args)
 {
     if (Debug)
     {
         Console.WriteLine($"DZ:{DataItem} DROP");
     }
     IsDropTarget = false;
     OnDragDrop?.Invoke(args, DataItem);
 }
Exemple #2
0
        public void ClearEvents()
        {
            foreach (DragDropCallback d in OnDragDrop.GetInvocationList())
            {
                OnDragDrop -= d;
            }

            foreach (DragDropCallback d in OnDragCancel.GetInvocationList())
            {
                OnDragCancel -= d;
            }

            foreach (DragDropCallback d in OnDragStart.GetInvocationList())
            {
                OnDragStart -= d;
            }
        }
Exemple #3
0
        static void Update(float Dt)
        {
            Glfw.PollEvents();

            Glfw.GetCursorPos(Window, out double CurX, out double CurY);
            Vector2 CurMousePos = new Vector2((float)CurX, (float)CurY);

            MouseDelta = CurMousePos - MousePos;
            MousePos   = CurMousePos;

            if (DragDropPaths != null)
            {
                OnDragDrop?.Invoke(DragDropPaths);
                DragDropPaths = null;
            }

            UpdatePhysics(Dt);
            UpdateEntities(Dt);
            Game.Update(Dt);
        }
Exemple #4
0
 public void DragDrop(object sender, DragEventArgs e)
 {
     OnDragDrop?.Invoke(sender, e);
 }