public bool Equals(NoteBook objNoteBook) { bool result = false; if (Author.Equals(objNoteBook.Author) && ENotes.Capacity == objNoteBook.ENotes.Capacity) { for (int i = 0; i < ENotes.Capacity; i++) { if (ENotes[i].Equals(objNoteBook.ENotes[i])) { result = true; } else { result = false; break; } } } else { result = false; } return(result); }
public void Open() { currentNoteBook = new NoteBook(); try { using (FileStream fs = new FileStream("Notebook.json", FileMode.OpenOrCreate)) { DataContractJsonSerializer jsonFormatter = new DataContractJsonSerializer(typeof(NoteBook)); currentNoteBook = (NoteBook)jsonFormatter.ReadObject(fs); } Console.WriteLine("NoteBook Opened!"); } catch (SerializationException) { Console.WriteLine("NoteBook can't be saved!"); } }
public NoteBookConsoleView(ref NoteBook noteBook) { this.ENoteBook = noteBook; }
public void Create() { currentNoteBook = new NoteBook(); Console.WriteLine("NoteBook Created!"); noteBookConsoleView = new NoteBookConsoleView(ref currentNoteBook); }