There is a list of tasks that were launched at the start of the application and each of them will not be executed against the background in an infinite loop. All tasks I keep in the list
public List<Task> BackGroundTask When I close a position what to do with these tasks for example in the handler
FormClosing() I looked in the debugger, the status of all tasks at the time of closing the window TaskStatus = WaitingForActivation. May need to pass CancellationToken to all tasks and in FormClosing () call Cancel () on CancellationToken? Infrastructure with token present. But I would like to know more options?