Exemplo n.º 1
0
 /// <summary>
 /// 撤销删除矩形内直线
 /// </summary>
 /// <param name="rectangle"></param>
 public void UnDeleteRectLine(MergeRectCommand command)
 {
     foreach (PartitionLine line in command.InRectLines)
     {
         AddLine(line.Start, line.End, line.Position, line.IsRow);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 删除矩形内直线
        /// </summary>
        /// <param name="rectangle"></param>
        public void DeleteRectLine(MergeRectCommand command)
        {
            command.InRectLines = FindInRectLine(command.BoundaryRect);

            foreach (PartitionLine line in command.InRectLines)
            {
                DeleteLine(line);
            }
        }
Exemplo n.º 3
0
 public void MergeMutiRects(MergeRectCommand command)
 {
     foreach (Rect rect in command.RemovedRects)
     {
         rect.IsDeleted = true;
     }
     this.X      = command.BoundaryRect.X;
     this.Y      = command.BoundaryRect.Y;
     this.Width  = command.BoundaryRect.Width;
     this.Height = command.BoundaryRect.Height;
 }
Exemplo n.º 4
0
        public void PartMutiRects(MergeRectCommand command)
        {
            foreach (Rect rect in command.RemovedRects)
            {
                rect.IsDeleted = false;
            }

            this.X      = command.LeftRect.X;
            this.Y      = command.LeftRect.Y;
            this.Width  = command.LeftRect.Width;
            this.Height = command.LeftRect.Height;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 响应合并矩形命令
        /// </summary>
        void MergeRect_Click(object sender, EventArgs e)
        {
            ///判断是否可以合并
            List <Rect> dismergableRects = this.ListRect.GetDisMergableRects();

            if (!ListRect.IsRectMergable())///可以合并
            {
                // MessageBox.Show("存在锁定或所选矩形无法完成合并!");
                MessageService.Show("${res:tmpltDesignTip.recMerge}", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                foreach (Rect rect in dismergableRects)
                {
                    //DrawRectFlash(rect);
                }
            }
            else
            {
                MergeRectCommand mergeRectCommand = new MergeRectCommand(TDPanel);
                mergeRectCommand.Execute();
            }
        }