private void Dump(TodoModel model) { Console.WriteLine("---------------------------------------------------------------"); foreach (var cat in model.Categories.Values) { Console.WriteLine("Category: <" + cat.Name + ">"); foreach (var todoItem in cat.Items) { Console.WriteLine(" --------Item-----------------------------------"); Console.WriteLine(" id:" + todoItem.Id); Console.WriteLine(" title:" + todoItem.Title); Console.WriteLine(" due:" + todoItem.Due); Console.WriteLine(" completed:" + todoItem.Completed); Console.WriteLine(" same ref: " + (model.Items[todoItem.Id] == todoItem)); } } }
private TodoModel BuildComplexModel() { var model = new TodoModel(); var eat = model.AddItem("Eat"); var sleep = model.AddItem("Sleep"); var code = model.AddItem("Code"); var play = model.AddItem("Play squash"); var taxes = model.AddItem("Do taxes"); var special = model.AddSpecialItem("Bake a cake"); model.SetCategories(special, "Fun"); model.SetCategories(taxes, "Work", "Boring"); model.SetCategories(eat, "Fun", "Health"); model.SetCategories(code, "Fun", "Work"); model.SetCategories(sleep, "Boring", "Health"); model.SetCategories(play, "Fun", "Health"); return model; }