Exemplo n.º 1
0
        public override void OnMouseMove(MouseActionEventArgs e)
        {
            base.OnMouseMove(e);
            Resolved = Resolved && Source != null;

            if (Resolved && (e.Button != MouseActionButtons.Left))
            {
                EndAction();
            }
            if (Resolved && !Dragging)
            {
                Dragging = true;
                InprocDragDrop.Dragging = true;
                InprocDragDrop.Data     = new GraphCursor <IVisual, IVisualEdge>(Scene.Graph, Source);

                try {
                    var startData =
                        new DragStartData(
                            DragDropViz.TransferDataOfVisual(Scene.Graph, Source),
                            DragDropAction.All,
                            GetDragImageBackend(Scene.Graph, Source),
                            e.Location.X, e.Location.Y);

                    DragDropHandler.DragStart(startData);
                } catch {} finally {
                    EndAction();
                }
            }
        }
Exemplo n.º 2
0
        public virtual void Copy()
        {
            if (false)
            {
                // TODO: it has to be cleared, if the next stuff is copied into clipboard
                // a clipboard Pasted-Event is needed
                InprocDragDrop.ClipboardData = new GraphCursor <IVisual, IVisualEdge>(Scene.Graph, Scene.Focused);
            }

            if (Scene.Focused == null)
            {
                Registry.Pooled <IMessageBoxShow> ().Show("Warning", "Select something to copy", MessageBoxButtons.Ok);
                return;
            }

            Clipboard.SetTransferData(DragDropViz.TransferDataOfVisual(Scene.Graph, Scene.Focused));
        }
Exemplo n.º 3
0
 public override TransferDataSource GetTransferData()
 {
     return(DragDropViz.TransferDataOfVisual(this.Scene.Graph, this.Scene.Focused));
 }