示例#1
0
        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);
        }
示例#2
0
 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!");
     }
 }
示例#3
0
 public NoteBookConsoleView(ref NoteBook noteBook)
 {
     this.ENoteBook = noteBook;
 }
示例#4
0
 public void Create()
 {
     currentNoteBook = new NoteBook();
     Console.WriteLine("NoteBook Created!");
     noteBookConsoleView = new NoteBookConsoleView(ref currentNoteBook);
 }