コード例 #1
0
 public static NewEntity Create(this ITodoListItemsContract contract, Int64 todoListId, TodoItemNew item)
 {
     return contract.Create(todoListId.ToString(), item);
 }
コード例 #2
0
        public void TodoListItems()
        {
            Console.WriteLine();
            Console.WriteLine("TodoListItems Contract Tests");
            Console.WriteLine("****************************");

            var projectService = this.Client.Projects;
            var todoListService = this.Client.TodoLists;

            var project = projectService.GetList().FirstOrDefault();

            if (project == null)
            {
                Console.WriteLine("No projects exists under this account");
                return;
            }

            Console.WriteLine("Project Name: {0}", project.Name);

            var todoList = todoListService.GetListInProject(project.Id, TodoListFilter.All).FirstOrDefault();

            var service = this.Client.TodoListItems;

            var todoListItems = service.GetList(todoList.Id);

            Console.WriteLine("Todo List Items Count: {0}", todoListItems.Count());

            var todoListItem = service.Get(todoListItems.First().Id);

            Console.WriteLine("Todo List Item: {0}", todoListItem.Content);

            var item = new TodoItemNew { Content = "test content", Notify = false, DueAt = DateTime.Now };
            var id = service.Create(todoList.Id, item);
            var newTodoListItem = service.Get(id.Id);

            Console.WriteLine("New Item: {0}", newTodoListItem.Content);

            item.Content = "test content again";
            service.Update(id.Id, item);
            var updateTodoListItem = service.Get(id.Id);

            Console.WriteLine("Update Item: {0}", updateTodoListItem.Content);

            service.Complete(id.Id);

            Console.WriteLine("Item Complete");

            service.Uncomplete(id.Id);

            Console.WriteLine("Item Uncomplete");

            service.Delete(id.Id);

            Console.WriteLine("Item Deleted");
        }
コード例 #3
0
 public static void Update(this ITodoListItemsContract contract, Int64 todoItemId, TodoItemNew item)
 {
     contract.Update(todoItemId.ToString(), item);
 }