/// <summary> /// Loads a .dcproject from a file stream. /// </summary> /// <param name="stm"></param> /// <returns></returns> public Project LoadProject(Stream stm) { var rdr = new XmlTextReader(stm); XmlSerializer ser = SerializedLibrary.CreateSerializer_v2(typeof(Project_v2)); if (ser.CanDeserialize(rdr)) { return(LoadProject((Project_v2)ser.Deserialize(rdr))); } ser = SerializedLibrary.CreateSerializer_v1(typeof(Project_v1)); if (ser.CanDeserialize(rdr)) { return(LoadProject((Project_v1)ser.Deserialize(rdr))); } return(null); }
public void Save(Project_v2 project, TextWriter sw) { XmlSerializer ser = SerializedLibrary.CreateSerializer_v1(typeof(Project_v2)); ser.Serialize(sw, project); }