public bool Export(String fileName) { try { Path = fileName; XElement xmlTree1 = new XElement("bleditor"); foreach (CharacterSet characterSet in charSets) { xmlTree1.Add(characterSet.Save(Path, true)); } foreach (Map map in maps) { xmlTree1.Add(MapSerializer.Save(map, Path, true)); } xmlTree1.Save(Path); SetSaved(); return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
public bool Save(String fileName = null) { try { Path = fileName ?? Path; XElement xmlTree1 = new XElement("bleditor"); foreach (CharacterSet characterSet in charSets) { xmlTree1.Add(characterSet.Save(Path)); } foreach (String include in Includes) { XElement includeElement = new XElement("include"); includeElement.SetValue(PathHelper.Delta(Path, include)); xmlTree1.Add(includeElement); } foreach (Map map in maps) { xmlTree1.Add(MapSerializer.Save(map, Path)); } xmlTree1.Save(Path); SetSaved(); return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }