예제 #1
0
        public override void Init(object sender)
        {
            BarEditItem item = sender as BarEditItem;

            if (item.Edit is RepositoryItemComboBox)
            {
                RepositoryItemComboBox ricb = item.Edit as RepositoryItemComboBox;
                string[] scale = new string[] { "1:500", "1:1000", "1:2000", "1:5000", "1:10000", "1:20000" };
                ricb.Items.AddRange(scale);
                item.EditValue = ricb.Items[0];
            }

            Map2DView mapView = (Map2DView)UCService.GetContent(typeof(Map2DView));

            mapView.Bind(this);
        }
예제 #2
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DView mapView = (Map2DView)UCService.GetContent(typeof(Map2DView));
            bool      bBind   = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }

            DF2DApplication app = (DF2DApplication)this.Hook;

            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            try
            {
                Layer2DTreePad wsPad = (Layer2DTreePad)UCService.GetContent(typeof(Layer2DTreePad));
                EagleEyePad    epad  = UCService.GetContent(typeof(EagleEyePad)) as EagleEyePad;
                if (wsPad == null || epad == null)
                {
                    return;
                }
                app.Workbench.SetStatusInfo("二维数据加载中…");
                SplashScreenManager.Default.SendCommand(null, "开始加载二维数据......");

                if (wsPad != null && epad != null)
                {
                    DataUtils2D.AddAndVisualizeTreelistPipe(wsPad.TreeList, app.Current2DMapControl);       //加载管线图层
                    DataUtils2D.AddAndVisualizeTreelistBackground(wsPad.TreeList, app.Current2DMapControl); //加载背景图及辅助图层,为鹰眼加载影像图
                    DataUtils2D.AddAndVisualizeEgleEyeControlBackground(epad.MapControl);
                }
                app.Workbench.SetStatusInfo("就绪");
                LoggingService.Info("二维数据加载成功!");
            }
            catch (Exception ex)
            {
                app.Workbench.SetStatusInfo("二维数据加载错误");
                LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace);
            }
        }