Can you describe precisely the UI steps you are executing to get this error? I am not able to replicate it by running your code snippet and then repeatedly clicking the "History" tab.
You code inspired me to add code that will automatically validate the TaskName property value and set the AcceptButton state. You will see that in 2.5.19.
By the way, you can accomplish the above with much simpler code:
You code inspired me to add code that will automatically validate the TaskName property value and set the AcceptButton state. You will see that in 2.5.19.
By the way, you can accomplish the above with much simpler code:
new TaskEditDialog(ts.GetTask(taskName)) { MaxHistoryCount = 100 }.ShowDialog();
When setting the dialog up with a task, you don't need to pull apart the TaskDefinition nor set the TaskName or handle the AcceptButton.