private void SaveConfig_Click(object sender, EventArgs e) { SaveFileDialog saveDlg = new SaveFileDialog(); saveDlg.DefaultExt = ".ml-cgc"; // Default file extension saveDlg.Filter = "CG config files (.ml-cgc)|*.ml-cgc"; // Filter files by extension if (saveDlg.ShowDialog() == DialogResult.OK) { IMLXMLPersist pXMLPersist = (IMLXMLPersist)m_Editor.CGObject; pXMLPersist.SaveToXMLFile(saveDlg.FileName, 1); } }
private void LoadConfig_Click(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.Multiselect = false; openFile.Filter = "CG config files (.ml-cgc)|*.ml-cgc"; // Filter files by extension if (openFile.ShowDialog() == DialogResult.OK) { IMLXMLPersist pXMLPersist = (IMLXMLPersist)m_Editor.CGObject; pXMLPersist.LoadFromXML(openFile.FileName, -1); m_Editor.UpdateItemsList(); List <CGBaseItem> items = m_Editor.CGItems; m_Editor.UpdateItemsList(); } }