Esempio n. 1
0
        //新建
        public static void NewDoc(AxMapControl mapControl, AxPageLayoutControl pageLayoutControl = null)
        {
            SaveFileDialog NewDlg = new SaveFileDialog();

            NewDlg.Title            = "新建文档";
            NewDlg.InitialDirectory = "C:\\Users\\Administrator\\Desktop";
            NewDlg.FileName         = "Default";
            NewDlg.Filter           = "mxd文件|*.mxd";
            if (NewDlg.ShowDialog() == DialogResult.OK)
            {
                if (MessageBox.Show("        是否保存当前文档?", "信息提示", MessageBoxButtons.YesNo) == DialogResult.OK)
                {
                    OperateFile.SaveDoc(mapControl);
                }
                IMapDocument pMapDocument = new MapDocumentClass();

                pMapDocument.New(NewDlg.FileName);
                pMapDocument.Open(NewDlg.FileName);
                mapControl.Map = pMapDocument.get_Map(0);
            }
        }
Esempio n. 2
0
 private void bt_save_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     OperateFile.SaveDoc(axMapControl1, axPageLayoutControl1);
 }