コード例 #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));
                }
            }
		}
コード例 #2
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));
                }
            }
        }
コード例 #3
0
        public ICategory[] GetCategoriesForType(CategoryType type)
        {
            string           requestPath = RequestPathForAction(string.Format("categories.xml?type={0}", type.ToString().ToLower()));
            List <ICategory> categories  = new List <ICategory>();

            try
            {
                foreach (XmlNode node in _service.GetRequestResponseElement(requestPath).ChildNodes)
                {
                    categories.Add(Category.GetInstance(Camp, node));
                }
            }
            catch
            {
                return(categories.ToArray());
            }
            return(categories.ToArray());
        }