feat(cancellation): adds readme example

This commit is contained in:
Dimitrie Stefanescu
2021-04-03 18:03:30 +01:00
parent bdc105fa95
commit b93aa1a76a
+20
View File
@@ -46,6 +46,26 @@ Q: Does this component use all my cores? A: OH YES. It goes WROOOM.
![image](https://user-images.githubusercontent.com/7696515/95597125-29310900-0a46-11eb-99ce-663b34506a7a.png)
Q: Can I enable cancellation of a longer running task?
A: Yes, now you can! In your component, just add a right click menu action like so:
```cs
public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
{
base.AppendAdditionalMenuItems(menu);
Menu_AppendItem(menu, "Cancel", (s, e) =>
{
RequestCancellation();
});
}
```
### Debugging
Quite easy: