예제 #1
0
 protected override async void OnClick()
 {
     // unload
     if (Module1.Current.taskGuid != Guid.Empty)
     {
         await TaskAssistantModule.CloseTaskAsync(Module1.Current.taskGuid);
     }
 }
예제 #2
0
        public void MainMethodCode()
        {
            // find the first project task item which is open
            var taskItem = Project.Current.GetItems <TaskProjectItem>().FirstOrDefault(t => t.IsOpen == true);

            // if there isn't a project task item, return
            if (taskItem == null)
            {
                return;
            }

            // close it
            // NOTE : The task item will also be removed from the project
            TaskAssistantModule.CloseTaskAsync(taskItem.TaskItemGuid);
        }