Esempio n. 1
0
        public void Run()
        {
            var fileName = ReadLineLimited("Введите путь и имя файла для импорта записей:");

            fileName += ".csv";
            NoteBook.Add(ReadInFile(fileName));
        }
Esempio n. 2
0
        public void Run()
        {
            var title = ReadLineLimited("Заголовок заметки:");
            var text  = ReadLineLimited("Текст заметки:", 0);
            var tags  = SplitTags(ReadLineLimited("Введите через пробел чувствительные к регистру теги:", 0));
            var date  = DateTime.Now;

            Note memo = new Note(text, title, tags, date);

            NoteBook.Add(memo);
        }
Esempio n. 3
0
        protected Store.Notebook ReadInFile(string path)
        {
            Store.Notebook newNotebook = new Store.Notebook();
            using (StreamReader sr = new StreamReader(path, Encoding.Unicode))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    string[] data  = line.Split('\t');
                    var      text  = data[0];
                    var      title = data[1];
                    var      tags  = SplitTags(data[2]);
                    var      date  = DateTime.Parse(data[3]);

                    newNotebook.Add(text, title, tags, date);
                }
            }
            return(newNotebook);
        }