/// <summary> /// 현재 데이터를 XML로 저장합니다. /// </summary> /// <returns></returns> public void SaveXml() { Directory.CreateDirectory(m_DefaultDirPath); using (var sw = new StreamWriter(m_DefaultDirPath + XmlType.ToString() + ".xml")) { m_XmlSerializer.Serialize(sw, ParsedData); } }
/// <summary> /// XML로부터 데이터를 불러옵니다. /// </summary> /// <returns></returns> public void LoadXml() { if (!File.Exists(m_DefaultDirPath + XmlType.ToString() + ".xml")) { this.SaveXml(); } using (var sr = new StreamReader(m_DefaultDirPath + XmlType.ToString() + ".xml")) { ParsedData = m_XmlSerializer.Deserialize(sr) as ParsedData; } }
private static XAttribute CreateTypeAttr(XmlType type) { return(new XAttribute("type", type.ToString())); }