Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 786 Bytes

defer_critical_project_operations.md

File metadata and controls

20 lines (15 loc) · 786 Bytes

Block/Defer critical project operations

You can block critical project operations (Build, Save, Rename, Unload) until specified tasks complete by registering your tasks via IProjectAsynchronousTasksService.

RegisterAsyncTask() with a ProjectCriticalOperation flag is provided to support this:

void RegisterAsyncTask(JoinableTask joinableTask, ProjectCriticalOperation operationFlags, bool registerFaultHandler = false)

E.g., if you want to defer the build, you can register your tasks that you want to wait on for build by passing in ProjectCriticalOperation.Build as the flag.

For closing project, we provide a CancellationToken you can use to bail out quickly instead of blocking project close for a long time.