示例#1
0
            /// <summary>
            /// 提取出主程序中含有Rolling方法的对象
            /// </summary>
            /// <returns>其中的每一个元素都是一个字典,以对象名称来索引对象
            /// 其中有三个元素,依次代表:剖面图、平面图和监测曲线图,
            /// 它不是指从mainform中提取出来的三个App的属性值,而是从这三个App属性中挑选出来的,正确地带有Rolling方法的相关类的实例对象。
            /// </returns>
            /// <remarks></remarks>
            public RollingEnabledDrawings ExposeRollingDrawings()
            {
                //
                ClsDrawing_ExcavationElevation Elevation      = default(ClsDrawing_ExcavationElevation);
                ClsDrawing_PlanView            Visio_PlanView = default(ClsDrawing_PlanView);
                Dictionary_AutoKey <Cls_ExcelForMonitorDrawing> Excel_Monitor = default(Dictionary_AutoKey <Cls_ExcelForMonitorDrawing>);

                Elevation      = GlobalApplication.Application.ElevationDrawing;
                Visio_PlanView = GlobalApplication.Application.PlanView_VisioWindow;
                Excel_Monitor  = GlobalApplication.Application.MntDrawing_ExcelApps;
                //
                //对象名称与对象
                try
                {
                    //剖面图
                    if (Elevation != null)
                    {
                        //RollingDrawings.SectionalView.Add(Elevation)
                    }
                }
                catch (Exception)
                {
                }

                try
                {
                    //平面图
                    if (Visio_PlanView != null)
                    {
                        //RollingDrawings.PlanView.Add(Visio_PlanView)
                    }
                }
                catch (Exception)
                {
                }
                List <clsDrawing_Mnt_RollingBase> RollingMntDrawings = new List <clsDrawing_Mnt_RollingBase>();

                try
                {
                    //监测曲线图
                    foreach (Cls_ExcelForMonitorDrawing MonitorSheets in Excel_Monitor.Values)
                    {
                        foreach (ClsDrawing_Mnt_Base sht in MonitorSheets.Mnt_Drawings.Values)
                        {
                            if (sht.CanRoll)
                            {
                                RollingMntDrawings.Add(sht);
                            }
                        }
                    }
                    //'数组中的每一个元素都是一个字典,以对象名称来索引对象
                }
                catch (Exception)
                {
                }
                //
                RollingEnabledDrawings RollingDrawings = new RollingEnabledDrawings(Elevation, Visio_PlanView, RollingMntDrawings);

                return(RollingDrawings);
            }
示例#2
0
        /// <summary>
        /// 获取用来绘图的Excel程序,并将此界面加入主程序的监测曲线集合
        /// </summary>
        /// <param name="NewExcelApp">按情况看是否要打开新的Application</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private Application GetApplication(bool NewExcelApp, Dictionary_AutoKey <Cls_ExcelForMonitorDrawing> MntDrawingExcelApps, ref Cls_ExcelForMonitorDrawing ExcelForMntDrawing)
        {
            Application app = default(Application);

            if (NewExcelApp) //打开新的Excel程序
            {
                app = new Application();
                ExcelForMntDrawing = new Cls_ExcelForMonitorDrawing(app);
            }
            else //在原有的Excel程序上作图
            {
                ExcelForMntDrawing = MntDrawingExcelApps.Last.Value;
                ExcelForMntDrawing.ActiveMntDrawingSheet.RemoveFormCollection();
                app = ExcelForMntDrawing.Application;
            }
            return(app);
        }
示例#3
0
            /// <summary>
            /// 主程序中所有的绘图,包括不能进行滚动的图形。比如开挖平面图,监测曲线图,开挖剖面图。
            /// </summary>
            /// <returns></returns>
            /// <remarks></remarks>
            public AmeDrawings ExposeAllDrawings()
            {
                Dictionary_AutoKey <Cls_ExcelForMonitorDrawing> Excel_Monitor = default(Dictionary_AutoKey <Cls_ExcelForMonitorDrawing>);
                //
                ClsDrawing_PlanView            Visio_PlanView = null;
                ClsDrawing_ExcavationElevation Elevation      = default(ClsDrawing_ExcavationElevation);
                List <ClsDrawing_Mnt_Base>     MonitorData    = new List <ClsDrawing_Mnt_Base>();

                //
                Elevation     = GlobalApplication.Application.ElevationDrawing;
                Excel_Monitor = GlobalApplication.Application.MntDrawing_ExcelApps;
                //

                //Me.F_AllDrawingsCount = 0
                //
                //对象名称与对象
                try
                {
                    //剖面图
                    Elevation = GlobalApplication.Application.ElevationDrawing;
                    if (Elevation != null)
                    {
                        //Me.F_AllDrawingsCount += 1
                    }
                }
                catch (Exception)
                {
                }

                try
                {
                    //平面图
                    Visio_PlanView = GlobalApplication.Application.PlanView_VisioWindow;
                    if (Visio_PlanView != null)
                    {
                        //Me.F_AllDrawingsCount += 1
                    }
                }
                catch (Exception)
                {
                }

                try
                {
                    //监测曲线图
                    foreach (Cls_ExcelForMonitorDrawing MonitorSheets in Excel_Monitor.Values)
                    {
                        foreach (ClsDrawing_Mnt_Base sht in MonitorSheets.Mnt_Drawings.Values)
                        {
                            MonitorData.Add(sht);
                            //Me.F_AllDrawingsCount += 1
                        }
                    }
                }
                catch (Exception)
                {
                }
                AmeDrawings AllDrawings = new AmeDrawings(Elevation,
                                                          Visio_PlanView,
                                                          MonitorData);

                return(AllDrawings);
            }