示例#1
0
        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;
        }
示例#2
0
        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;
        }