public static CygwinModel GetScriptDetails(string filename) { CygwinModel cygwinModel = new CygwinModel(); try { XmlSerializer xs = new XmlSerializer(cygwinModel.GetType()); using (TextReader reader = new StreamReader(filename)) { cygwinModel = (CygwinModel)xs.Deserialize(reader); } } catch (Exception) { throw; } return cygwinModel; }
public static Boolean SaveScriptDetails(CygwinModel cygwinModel, string filename) { try { XmlSerializer xs = new XmlSerializer(cygwinModel.GetType()); using (TextWriter writer = new StreamWriter(filename)) { xs.Serialize(writer, cygwinModel); } } catch (Exception) { throw; } return true; }