public static bool SaveDocument(object object_0, string string_0) { if (object_0 is IAppContext) { object_0 = (object_0 as IAppContext); } for (int i = 0; i < m_pList.Count; i++) { MxDocument document = m_pList[i]; if (document.Hook == object_0) { return(document.Save(string_0)); } } return(false); }
public static bool SaveDocumentAs(object object_0) { if (object_0 is IAppContext) { object_0 = (object_0 as IAppContext); } MxDocument document = null; for (int i = 0; i < m_pList.Count; i++) { document = m_pList[i]; if (document.Hook == object_0) { break; } } if (document != null) { SaveFileDialog dialog = new SaveFileDialog { OverwritePrompt = true, Title = "保存为", Filter = "ArcMap Document (*.mxd)|*.mxd|ArcMap Template (*.mxt)|*.mxt|Published Maps (*.pmf)|*.pmf|所有支持Map格式|*.mxd;*.mxt;*.pmf", FilterIndex = 0, RestoreDirectory = true, FileName = document.DocumentFilename }; switch (dialog.ShowDialog()) { case DialogResult.Cancel: return(true); case DialogResult.OK: document.Save(dialog.FileName); break; } } return(false); }