예제 #1
0
        private static void DeleteTask(ExchangeService service, string Subject, DeleteMode deleteMode)
        {
            // Try to retrieve the task specified by the subject.
            Task task = Ex15_FindTaskBySubject_CS.FindTaskBySubject(service, Subject);

            // If the task if found, delete it with the specified deleteMode.
            if (task != null)
            {
                task.Delete(deleteMode);
                Console.WriteLine("Task deleted.");
            }
            else
            {
                Console.WriteLine("Task not found.");
            }
        }
        static void UpdateTask(ExchangeService service, string Subject)
        {
            // Try to retrieve the task specified by the subject.
            Task FoundTask = Ex15_FindTaskBySubject_CS.FindTaskBySubject(service, Subject);

            // If the task if found, set the status to "Completed".
            if (FoundTask != null)
            {
                Task task = Task.Bind(service, FoundTask.Id);
                task.Status = TaskStatus.Completed;
                task.Update(ConflictResolutionMode.AutoResolve);
                Console.WriteLine("Task updated as being completed.");
            }
            else
            {
                Console.WriteLine("Task not found.");
            }
        }