Exemple #1
0
        private ToDoList(IBaseCamp baseCamp, IRestWebService service, JObject node, int projectID)
        {
            _camp     = baseCamp;
            _service  = service;
            ID        = node["id"].ToObject <int>();
            ProjectID = projectID;
            Items     = new List <IToDoListItem>();

            foreach (var toDoListItem in node["todos"]["remaining"])
            {
                var path = string.Format("projects/{0}/{1}/{2}.json", ProjectID, "todos", toDoListItem["id"]);
                foreach (JObject node1 in _service.GetRequestResponseElement(path))
                {
                    Items.Add(ToDoListItem.GetInstance(_camp, node1));
                }
            }
            foreach (var toDoListItem in node["todos"]["completed"])
            {
                var path = string.Format("projects/{0}/{1}/{2}.json", ProjectID, "todos", toDoListItem["id"]);
                foreach (JObject node1 in _service.GetRequestResponseElement(path))
                {
                    Items.Add(ToDoListItem.GetInstance(_camp, node1));
                }
            }
        }
Exemple #2
0
 public IToDoListItem GetToDoListItemById(int id)
 {
     return(ToDoListItem.GetInstance(this, Service.GetRequestResponseElement(ToDoListItem.PathForId(id))));
 }