/// <summary>
        /// 对工作区域的各对象操作的历史记录进行Undo操作
        /// </summary>
        /// <param name="drawWorkspace">工作区域</param>
        public void PerformAction(DrawWorkSpace drawWorkspace)
        {
            int countOfListHistoryUndo = drawWorkspace.ListHistoryUndo.Count;
            if (countOfListHistoryUndo > 0)
            {
                drawWorkspace.GraphicsList.Clear();
                if (countOfListHistoryUndo > 1)
                {
                    #region 回到上一个历史记录的状态
                    AojReportObjectCollection lstTemp = AojCommonFnc.CopyReportObject(drawWorkspace.ListHistoryUndo[1]);
                    drawWorkspace.GraphicsList = lstTemp;
                    //记录报表设计区域历史记录Redo的相关对象集合
                    lstTemp = AojCommonFnc.CopyReportObject(drawWorkspace.ListHistoryUndo[0]);
                    drawWorkspace.ListHistoryRedo.Insert(0, lstTemp);
                    //每进行一次Undo操作就从Undo历史记录中去掉一个
                    drawWorkspace.ListHistoryUndo.RemoveAt(0);
                    #endregion
                }
                else
                {
                    //回到历史记录的初始状态
                    AojReportObjectCollection lstTemp = AojCommonFnc.CopyReportObject(drawWorkspace.ListHistoryUndo[0]);
                    drawWorkspace.GraphicsList = lstTemp;
                }

                #region 对相关size进行缩放处理
                foreach (AojReportObject item in  drawWorkspace.GraphicsList)
                {
                    SetObjectSizeByPagesizePercent(item, drawWorkspace.PagesizePercent);
                }
                #endregion

                drawWorkspace.Refresh();
            }
        }
 /// <summary>
 /// 对报表设计区域为网格布局(GridStyle)时各点的距离的放大
 /// </summary>
 /// <param name="drawWorkspace">指定的工作区域</param>
 private void SetDistanceAboutGridStyleByPagesizePercent(DrawWorkSpace drawWorkspace)
 {
     //指定报表设计区域为网格布局(GridStyle)时
     if (drawWorkspace.GridStyleFlag)
     {
         drawWorkspace.DistanceAboutGridStyle = (int)(drawWorkspace.NormalDistanceAboutGridStyle * drawWorkspace.PagesizePercent);
     }
 }
 /// <summary>
 /// 对指定的工作区域的对象进行缩放的详细处理动作
 /// </summary>
 /// <param name="drawWorkspace">指定的工作区域</param>
 public void PerformAction(DrawWorkSpace drawWorkspace)
 {
     //对报表设计区域为网格布局(GridStyle)时各点的距离的放大
     this.SetDistanceAboutGridStyleByPagesizePercent(drawWorkspace);
     //根据选择的倍率对报表设计区域的所有对象进行缩放处理
     this.SetReportObjectSizeByPagesizePercent(drawWorkspace);
     drawWorkspace.Refresh();
 }
示例#4
0
        /// <summary>
        /// 对指定的工作区域的对象进行复制的详细处理动作
        /// </summary>
        /// <param name="drawWorkspace">指定的工作区域</param>
        public void PerformAction(DrawWorkSpace drawWorkspace)
        {
            #region 将指定的自定义格式的相关数据存到剪贴板上

            //报表设计器区域被选中的对象
            List<AojReportObject> lstObjectSelected = drawWorkspace.GraphicsList.ListObjectSelected;
            //将相关数据存到剪贴板上
            AojCommonFnc.SaveObjectToClipBoard(lstObjectSelected);

            #endregion
        }
        /// <summary>
        /// 对工作区域的各对象操作的历史记录进行Redo操作
        /// </summary>
        /// <param name="drawWorkspace">工作区域</param>
        public void PerformAction(DrawWorkSpace drawWorkspace)
        {
            if (drawWorkspace.ListHistoryRedo.Count > 0)
            {
                drawWorkspace.GraphicsList.Clear();
                AojReportObjectCollection lstTemp = AojCommonFnc.CopyReportObject(drawWorkspace.ListHistoryRedo[0]);
                drawWorkspace.GraphicsList = lstTemp;
                lstTemp = AojCommonFnc.CopyReportObject(drawWorkspace.GraphicsList);
                drawWorkspace.ListHistoryUndo.Insert(0, lstTemp);
                //每进行一次Redo操作就从Redo历史记录中去掉一个
                drawWorkspace.ListHistoryRedo.RemoveAt(0);

                #region 对相关size进行缩放处理
                foreach (AojReportObject item in drawWorkspace.GraphicsList)
                {
                    SetObjectSizeByPagesizePercent(item, drawWorkspace.PagesizePercent);
                }
                #endregion

                drawWorkspace.Refresh();
            }
        }
 /// <summary>
 /// 根据选择的倍率对报表设计区域的所有对象进行缩放处理
 /// </summary>
 /// <param name="drawWorkspace">指定的工作区域</param>
 private void SetReportObjectSizeByPagesizePercent(DrawWorkSpace drawWorkspace)
 {
     //对报表设计器中的所有对象进行遍历
     foreach (AojReportObject objectItem in drawWorkspace.GraphicsList)
     {
         //获得选择的倍率信息
         float pagesizePercent = drawWorkspace.PagesizePercent;
         //根据选择的倍率对指定对象的相关size进行缩放处理
         this.SetObjectSizeByPagesizePercent(objectItem, pagesizePercent);
     }
 }
 /// <summary>
 /// 对指定的工作区域的对象进行全部选中的详细处理动作
 /// </summary>
 /// <param name="drawWorkspace">指定的工作区域</param>
 public void PerformAction(DrawWorkSpace drawWorkspace)
 {
     drawWorkspace.GraphicsList.SelectAll();
     drawWorkspace.Refresh();
 }