Esempio n. 1
0
        /// <summary>
        /// 设置新位置
        /// </summary>
        /// <param name="p_node"></param>
        /// <param name="p_taget"></param>
        /// <param name="p_rect"></param>
        void SetLoc(NodeSelector p_node, FrameworkElement p_taget, Rect p_rect)
        {
            if (p_rect.Left > 0 && p_rect.Top > 0 &&
                p_rect.Width > 0 && p_rect.Height > 0)
            {
                //位置节点与目标相同,同步更新位置节点
                if (p_node.Target == p_taget)
                {
                    Canvas.SetLeft(p_node, p_rect.Left);
                    Canvas.SetTop(p_node, p_rect.Top);
                    p_node.Width  = p_rect.Width;
                    p_node.Height = p_rect.Height;
                }
                Canvas.SetLeft(p_taget, p_rect.Left);
                Canvas.SetTop(p_taget, p_rect.Top);
                p_taget.Width  = p_rect.Width;
                p_taget.Height = p_rect.Height;
                _owner.UpdateLayout();
                _owner.RefreshLinkLines(p_taget);


                if (p_node.Owner.SelectedNodes.Count == 0)
                {
                    p_node.Owner.SelectionClerk.Select(p_taget, false);
                }
                else
                {
                    p_node.Target = p_taget;
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 调整大小参数
 /// </summary>
 /// <param name="p_node">位置点</param>
 /// <param name="p_oldRect">调整前位置</param>
 /// <param name="p_newRect">新位置</param>
 public ResizeArgs(NodeSelector p_node, Rect p_oldRect, Rect p_newRect)
 {
     _node    = p_node;
     _oldRect = p_oldRect;
     _newRect = p_newRect;
     _target  = p_node.Target;
 }
Esempio n. 3
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="p_nodeSelector"></param>
 /// <param name="p_selRect"></param>
 public void Init(NodeSelector p_nodeSelector, Rectangle p_selRect)
 {
     _nodeSelector = p_nodeSelector;
     _selRect      = p_selRect;
 }