private void zoomctrl_PreviewDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(object)))
            {
                //how to get dragged data by its type
                var myobject = e.Data.GetData(typeof(object)) as object;

                var pos = zoomctrl.TranslatePoint(e.GetPosition(zoomctrl), Area);

                var data = DataVertex.Create();

                CreateVertex(Area, zoomctrl, data, pos.X, pos.Y);
            }
        }
Example #2
0
        public VertexOperation(GraphArea graph, DataVertex data = null, Action <DataVertex, VertexControl> callback = null, Action <DataVertex> undoCallback = null)
        {
            _graph        = graph;
            _callback     = callback;
            _undoCallback = undoCallback;

            if (data != null)
            {
                _vertex = data;
            }
            else
            {
                _vertex = DataVertex.Create();
            }

            Status = Orc.GraphExplorer.Status.Init;
        }