예제 #1
0
 public void Write(string registTarget)
 {
     using (var streamWriter = StreramFactory.CreateStreamWriter(_registFilePath))
     {
         streamWriter.WriteLine(registTarget);
     }
 }
예제 #2
0
        public string Read()
        {
            string registPath;

            using (var sreamReader = StreramFactory.CreateStreamReader(_registFilePath))
            {
                registPath = sreamReader.ReadToEnd();
            }
            return(registPath);
        }
예제 #3
0
        private IEnumerable <string> GetRegistlations()
        {
            string line;
            var    registlations = new List <string>();

            using (var streamReader = StreramFactory.CreateStreamReader(_registlationPath))
            {
                while ((line = streamReader.ReadLine()) != null)
                {
                    registlations.Add(line);
                }
            }
            return(registlations);
        }
예제 #4
0
        public void Execute(IEnumerable <string> args)
        {
            var arg = args.ToList()[0];

            if (!IsExistDataFile())
            {
                File.Create(_registlationPath).Close();
            }

            using (var streamWriter = StreramFactory.CreateStreamWriter(_registlationPath))
            {
                streamWriter.WriteLine(arg);
            }
        }