Exemplo n.º 1
0
        private void tvTypes_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (draggedNode != null)
            {
                TreeNode node = tvTypes.GetNodeAt(e.X, e.Y);
                if (CanDrop(node))
                {
                    try
                    {
                        GType      draggedType = (GType)draggedNode.Tag;
                        GComposite comp        = (GComposite)node.Tag;
                        draggedType.Move(comp);
//						if(lib.HasDb) using(Context context=lib.GetContext()) draggedType.Save(context);
                        RemoveNode(draggedNode);
                        AddNode(node, draggedType);
                        if (OnTypeMoved != null)
                        {
                            OnTypeMoved(this, new TypeEventArgs(draggedType));
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Exception(ex);
                    }
                    finally
                    {
                    }
                }
                EndDragging();
            }
        }