コード例 #1
0
ファイル: ToolLib.cs プロジェクト: chinasio/minegis
 public ToolLib(frmMain frmMian)
 {
     m_frmMian = frmMian;
     m_mapControl = frmMian.MapControl;
     m_pageLayoutControl = frmMian.PageLayoutControl;
     m_sceneControl = frmMian.SceneControl;
     m_workSpace = frmMian.WorkSpace;
     m_gcon = frmMian.Gcon;
     m_connStr = frmMian.ConnectionString;
     m_statusBar = frmMian.StatusBar;
     m_activeView = frmMian.MapControl.ActiveView;
 }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: chinasio/minegis
        private IWorkspace m_workSpace = null; //空间数据库的工作空间

        #endregion Fields

        #region Constructors

        public frmMain()
        {
            InitializeComponent();

            m_currentWin = this;

            //初始化地图控件对象
            m_mapControl = this.mapCtlMain.Object as IMapControlDefault;
            m_pageLayoutControl = this.axPageLayoutControl1.Object as IPageLayoutControlDefault;
            m_tocControl = this.axTOCControl1.Object as ITOCControlDefault;
            m_sceneControl = this.axSceneControl1.Object as ISceneControlDefault;
            m_pageLayoutControl.ActiveView.ShowScrollBars = true;
            m_pageLayoutControl.ActiveView.ShowRulers = true;
            PageLayoutToolBarInit(); //PageLayout右键菜单

            //同步类,使mapcontrol和pagelayoutcontrol中的数据保持一致
            m_controlsSynchronizer = new ControlsSynchronizer(m_mapControl, m_pageLayoutControl);
            m_controlsSynchronizer.BindControls(true);
            m_controlsSynchronizer.AddFrameWorkControl(this.axTOCControl1.Object);

            //绑定地图控件
            this.axTOCControl1.SetBuddyControl(this.mapCtlMain);

            m_fgdbPath = ConfigurationManager.AppSettings["FGDBPath"];
            //连接数据库,返回工作空间
            m_gcon = new GDBConenction(this.m_fgdbPath);
            m_workSpace = m_gcon.OpenSDEWorkspace();
            m_SDEClick = false;
            m_gdata = new GDBData(m_workSpace);
            //获取关系数据库连接字符串
            m_connectionString = ConfigurationManager.AppSettings["ConnectionString"];

            //获取主界面进度条
            m_statusBar = this.uiStatusBar1;

            //初始化工具类
            m_toolLib = new ToolLib(m_currentWin);
            m_toolLib.CurrentControl = "map";//默认mapcontrol为出示当前控件

            //打开关系数据库
            m_oraConn = new OleDbConnection(m_connectionString);
            try
            {
                m_oraConn.Open();
                m_oraCmd = m_oraConn.CreateCommand();
            }
            catch(Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }