In my application every layer have it's own form with some information.
The user have a table where each record have a layer name. When the user double click a record the layer's form should be opened.
There are two checks before the form is opened. The layer must be in the TOC and no other layer form is open.
If any of these conditions exists I show MessageBox and do not open the form.
The check of the layer in TOC must be in QueuedTask since I need to get the database name (in the TOC the layer have the alias name).
So I have to do check 1, possible show message box and then do check 2.
Putting everything into one QueuedTask have a problem with messagebox. It jump to the second test while the messagebox is still on the screen.
Any good way to do it?