Example #1
0
 public void RemoveConnection()
 {
     if (connection != null)
     {
         connection.RemoveConnection(this);
         connection = null;
         FindForm().Controls.Remove(line);
     }
 }
Example #2
0
        private void OnDragDrop(object sender, DragEventArgs e)
        {
            if (connection != null)
            {
                RemoveConnection();
            }

            Form form = FindForm();
            connection = (OutLabel)e.Data.GetData(typeof(OutLabel));
            connection.AddConnection(this);
            DragDot dh = connection.DragHandle;
            this.line = new ConnectionLine();
            this.line.End = form.PointToClient(PointToScreen(DragHandle.Center));
            this.line.Start = form.PointToClient(connection.PointToScreen(dh.Center));
            form.Controls.Add(line);
            form.Invalidate();
        }