public void CreateNote(string topic, string text, bool isImportant, DateTime deadline) { Console.WriteLine("created note with deadline param"); if (deadline == null || deadline < DateTime.Now) { DefaultNote note = (DefaultNote)defaultNoteCreator.Create(topic, text, isImportant, deadline); Current.Insert(0, note); //visitor note.SetDetailInfo(new DetailInfoVisitor()); } else { DeadlinedNote note = (DeadlinedNote)deadlinedNoteCreator.Create(topic, text, isImportant, deadline); Current.Insert(0, note); //visitor note.SetDetailInfo(new DetailInfoVisitor()); } }
public string VisitDefaultNote(DefaultNote note) { return("created: " + note.Time.ToString()); }