Esempio n. 1
0
 void ToolboxWidget_DragBegin(object sender, EventArgs e)
 {
     if (this.toolboxWidget.SelectedItem != null)
     {
         DragBegin?.Invoke(this, e);
     }
 }
        private void Hook_EventReceived(WinEventEventArgs args)
        {
            try
            {
                switch (args.Event)
                {
                case WinEvent.EVENT_SYSTEM_MOVESIZESTART:
                    if (args.Window.Equals(Window))
                    {
                        IsDragging = true;
                        DragBegin?.Invoke(this, new EventArgs());
                    }
                    break;

                case WinEvent.EVENT_SYSTEM_MOVESIZEEND:
                    if (args.Window.Equals(Window))
                    {
                        OnWindowMoved();
                        DragEnd?.Invoke(this, new EventArgs());
                        IsDragging = false;
                    }
                    break;

                case WinEvent.EVENT_OBJECT_LOCATIONCHANGE:
                case WinEvent.EVENT_SYSTEM_FOREGROUND:
                    if (!IsDragging)
                    {
                        OnWindowMoved();
                    }
                    break;

                case WinEvent.EVENT_SYSTEM_MINIMIZEEND:
                case WinEvent.EVENT_SYSTEM_MINIMIZESTART:
                    OnWindowMoved();
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Exception?.Invoke(this, new UnhandledExceptionEventArgs(ex, false));
            }
        }
 public override bool CanDragItems(NSCollectionView collectionView, NSSet indexPaths, NSEvent theEvent)
 {
     DragBegin?.Invoke(this, null);
     return(false);
 }