Exemple #1
0
 void prepare_info()
 {
     info_strings = new List <string>();
     using (FileStream f_stream = new FileStream(filename, FileMode.Open))
     {
         using (StreamReader sreader = new StreamReader(f_stream, ParserData.GetEncoding()))
         {
             string source_str = null;
             while ((source_str = sreader.ReadLine()) != null)
             {
                 info_strings.Add(source_str);
             }
         }
     }
 }
        /// <summary>
        ///
        /// </summary>
        public void Save()
        {
            List <string> info = prepare_info();

            using (FileStream f_stream = new FileStream(filename, FileMode.CreateNew))
            {
                using (StreamWriter s_writer = new StreamWriter(f_stream, ParserData.GetEncoding()))
                {
                    foreach (string element in info)
                    {
                        s_writer.WriteLine(element);
                    }
                }
            }
        }