Пример #1
0
        //保存
        public static void SaveDoc(AxMapControl mapControl, AxPageLayoutControl pageLayoutControl = null)
        {
            //判断文档是否为只读文档
            IMapDocument pMapDocument = new MapDocumentClass();

            if (mapControl.Map.LayerCount != 0 && mapControl.DocumentFilename != null)
            {
                pMapDocument.Open(mapControl.DocumentFilename);
                if (pMapDocument.get_IsReadOnly(pMapDocument.DocumentFilename))
                {
                    MessageBox.Show("此地图文档为只读文档", "信息提示");
                    return;
                }
                //用相对路径保存地图文档
                pMapDocument.Save(pMapDocument.UsesRelativePaths, true);
                MessageBox.Show("保存成功!", "信息提示");
            }
            else
            {
                OperateFile.SaveDocAs(mapControl, pageLayoutControl);
            }
        }
Пример #2
0
 private void bt_save_as_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     OperateFile.SaveDocAs(axMapControl1, axPageLayoutControl1);
 }