IDocument pDoc = null; IApplication pApp = null; try { pDoc = new MxDocumentClass(); pApp = pDoc.Parent; pApp.OpenDocument(sMxdFileName); // save file IMapDocument mapDoc = (IMapDocument)pDoc; mapDoc.Save(true, true); // suppress "do you want to save dialog" IDocumentDirty2 dirty = (IDocumentDirty2)pDoc; dirty.SetClean(); } finally { if (pDoc != null) { Marshal.ReleaseComObject(pDoc); } if (pApp != null) { pApp.Shutdown(); Marshal.ReleaseComObject(pApp); } }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.