示例#1
0
 public void AddNote(Note note)
 {
     ESchoolDiaryData.Notes.Add(note);
 }
示例#2
0
        private static void LoadNotes()
        {
            string filePath = @"../../Data/students_notes.txt";

            StreamReader reader = new StreamReader(filePath);
            using (reader)
            {
                string currentLine = reader.ReadLine();

                while (currentLine != null)
                {
                    string[] currentLineArray = currentLine.Split('#');

                    Note currentNote = new Note(long.Parse(currentLineArray[0]), currentLineArray[1]);

                    ESchoolDiaryData.Notes.Add(currentNote);

                    currentLine = reader.ReadLine();
                }
            }
        }