Beispiel #1
0
        private void MainForm_MS_Load(object sender, EventArgs e)
        {
            SocketUtil.DoInitilization();

            //////////////////////////////////////////////////////
            Log.Debug("[MS]...Loading Mxd file......");
            mapControl_MS.LoadMxFile(Application.StartupPath + "\\" +
                                     ConfigManager.Instance.getValueByKey(ConfigConst.CONFIG_MXD_FILE));
            Log.Debug("[MS]...Finished loading Mxd file......");
            statusStrip1.AxMap      = mapControl_MS;
            m_FileMenu.AxMapControl = mapControl_MS; //传入MapControl控件

            var mapControl     = (IMapControl3)mapControl_MS.Object;
            var toolbarControl = (IToolbarControl)toolBar_MS.Object;

            //绑定控件
            toolBar_MS.SetBuddyControl(mapControl);
            tocControl_MS.SetBuddyControl(mapControl);

            //获得工作空间
            //string strProvide = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";
            //string strDataSource = Application.StartupPath + @"\GasWarning-ChengZhuang.mdb";
            //MDBOperation.GetODbConnection(strProvide + strDataSource);
            //IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactory();
            //IWorkspace workspace = workspaceFactory.OpenFromFile(strDataSource, 0);

            //给全局变量赋值
            //给全局变量赋值
            DataEditCommon.g_tbCtlEdit     = toolbarControl;
            DataEditCommon.g_pAxMapControl = mapControl_MS;
            DataEditCommon.g_axTocControl  = tocControl_MS;
            DataEditCommon.load();

            //添加Toolbar
            //this.toolBar_MS.AddToolbarDef(new GIS_ToolbarView());
            //this.toolBar_MS.AddToolbarDef(new GIS_ToolbarEdit(this.mapControl_MS, mapControl, toolbarControl, DataEditCommon.g_pCurrentWorkSpace));
            ////this.toolBar_GM.AddToolbarDef(new GIS_ToolbarSpecial());
            //this.toolBar_MS.AddToolbarDef(new GIS_ToolbarModify());
            //this.toolBar_MS.AddToolbarDef(new GIS_ToolbarBasic());
            AddToolBar.Addtool(mapControl_MS, mapControl, toolbarControl, DataEditCommon.g_pCurrentWorkSpace);
            //地图操作初始化
            Global.SetInitialParams(mapControl_MS.ActiveView);

            Log.Debug("[MS]...Finished Constructing Main Form......"); //浮动工具条中文设置
            AutoUpdater.Start("http://bltmld.vicp.cc:8090/sys2/update.xml");
            DXSeting.floatToolsLoadSet();
        }
Beispiel #2
0
        private void MainForm_GM_Load(object sender, EventArgs e)
        {
            SocketUtil.DoInitilization();
            Log.Debug("[GM]....Ready to load MXD file.....");
            ///文件菜单
            mapControl_GM.LoadMxFile(Application.StartupPath + "\\" +
                                     ConfigManager.Instance.getValueByKey(ConfigConst.CONFIG_MXD_FILE));
            //this.mapControl_GM.LoadMxFile(Application.StartupPath + "\\local.mxd");
            Log.Debug("[GM]....Finished to load MXD file.....");
            statusStrip1.AxMap      = mapControl_GM;
            m_FileMenu.AxMapControl = mapControl_GM; //传入MapControl控件

            ///加载数据
            var mapControl     = (IMapControl3)mapControl_GM.Object;
            var toolbarControl = (IToolbarControl)toolBar_GM.Object;

            //绑定控件
            toolBar_GM.SetBuddyControl(mapControl);
            tocControl_GM.SetBuddyControl(mapControl);

            //给全局变量赋值
            DataEditCommon.g_tbCtlEdit     = toolbarControl;
            DataEditCommon.g_pAxMapControl = mapControl_GM;
            DataEditCommon.g_axTocControl  = tocControl_GM;
            DataEditCommon.load();
            AddToolBar.Addtool(mapControl_GM, mapControl, toolbarControl, DataEditCommon.g_pCurrentWorkSpace);

            //给GIS工程的全局变量赋值
            Global.SetInitialParams(mapControl_GM.ActiveView);

            Log.Debug("[GM]....Construction finished.");

            //浮动工具条中文设置
            AutoUpdater.Start("http://bltmld.vicp.cc:8090/sys3/update.xml");
            DXSeting.floatToolsLoadSet();

            Log.Debug("[GM]....Loading finished.");
        }
Beispiel #3
0
        private void MainForm_OP_Load(object sender, EventArgs e)
        {
            SocketUtil.DoInitilization();
            mapControl_OP.LoadMxFile(Application.StartupPath + "\\" +
                                     ConfigManager.Instance.getValueByKey(ConfigConst.CONFIG_MXD_FILE));
            statusStrip1.AxMap      = mapControl_OP;
            m_FileMenu.AxMapControl = mapControl_OP; //传入MapControl控件
            var mapControl     = (IMapControl3)mapControl_OP.Object;
            var toolbarControl = (IToolbarControl)toolbar_OP.Object;

            //绑定控件
            toolbar_OP.SetBuddyControl(mapControl);
            tocControl_OP.SetBuddyControl(mapControl);
            //给全局变量赋值
            DataEditCommon.g_tbCtlEdit     = toolbarControl;
            DataEditCommon.g_pAxMapControl = mapControl_OP;
            DataEditCommon.g_axTocControl  = tocControl_OP;
            DataEditCommon.load();
            AddToolBar.Addtool(mapControl_OP, mapControl, toolbarControl, DataEditCommon.g_pCurrentWorkSpace);


            AutoUpdater.Start("http://bltmld.vicp.cc:8090/sys4/update.xml");
            DXSeting.floatToolsLoadSet();
        }
Beispiel #4
0
        private void MainForm_WM_Load(object sender, EventArgs e)
        {
            SocketUtil.DoInitilization();
            //////////////////////////////////////////////////////
            ///文件菜单
            mapControl_WM.LoadMxFile(Application.StartupPath + "\\" +
                                     ConfigManager.Instance.getValueByKey(ConfigConst.CONFIG_MXD_FILE));
            //this.mapControl_WM.LoadMxFile(Application.StartupPath + "\\local.mxd");
            toolStrip1.AxMap        = mapControl_WM;
            m_FileMenu.AxMapControl = mapControl_WM; //传入MapControl控件


            //////////////////////////////////////////////////////
            //绘制基本图元工具条
            //加载测试数
            var mapControl     = (IMapControl3)mapControl_WM.Object;
            var toolbarControl = (IToolbarControl)toolBar_WM.Object;

            //绑定控件
            toolBar_WM.SetBuddyControl(mapControl);
            tocControl_WM.SetBuddyControl(mapControl);

            //获得工作空间
            //string strProvide = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";
            //string strDataSource = Application.StartupPath + @"\GasWarning-ChengZhuang.mdb";
            //MDBOperation.GetODbConnection(strProvide + strDataSource);
            //IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactory();
            //IWorkspace workspace = workspaceFactory.OpenFromFile(strDataSource, 0);

            //this.toolBar_WM.AddItem("esriControls.ControlsMapNavigationToolbar");
            //this.toolBar_WM.AddItem("esriControls.ControlsMapRefreshViewCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);

            //给全局变量赋值
            DataEditCommon.g_tbCtlEdit     = toolbarControl;
            DataEditCommon.g_pAxMapControl = mapControl_WM;
            DataEditCommon.g_axTocControl  = tocControl_WM;
            DataEditCommon.load();

            //添加Toolbar
            //toolBar_WM.AddToolbarDef(new GIS_ToolbarView());
            //toolBar_WM.AddToolbarDef(new GIS_ToolbarEdit(mapControl_WM, mapControl, toolbarControl,
            //    DataEditCommon.g_pCurrentWorkSpace));
            ////this.toolBar_WM.AddToolbarDef(new GIS_ToolbarSpecial());
            //toolBar_WM.AddToolbarDef(new GIS_ToolbarModify());
            //toolBar_WM.AddToolbarDef(new GIS_ToolbarBasic());
            AddToolBar.Addtool(mapControl_WM, mapControl, toolbarControl, DataEditCommon.g_pCurrentWorkSpace);

            Global.SetInitialParams(mapControl_WM.ActiveView);


            AutoUpdater.Start("http://bltmld.vicp.cc:8090/sys5/update.xml");
            //注册更新预警结果事件

            SocketUtil.GetClientSocketInstance().OnMsgUpdateWarningResult += UpdateWarningResultUi;
            var msg = new SocketMessage(COMMAND_ID.REGISTER_WARNING_RESULT_NOTIFICATION_ALL, DateTime.Now);

            SocketUtil.SendMsg2Server(msg);

            //浮动工具条中文设置
            DXSeting.floatToolsLoadSet();

            ShowLatestWarningResult();
        }
Beispiel #5
0
 private void MainForm_GE_Load(object sender, EventArgs e)
 {
     AutoUpdater.Start("http://bltmld.vicp.cc:8090/sys1/update.xml");
     DXSeting.floatToolsLoadSet();
 }