Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I can only claim that I've thought about this (prior reading your question ;). First I'd rig the places where this actually matters; for example the DB access chokepoint. If there is a place that should not be executed in the "UI" context (you can save it from <a href="http://msdn.microsoft.com/en-us/library/system.threading.synchronizationcontext.current.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.threading.synchronizationcontext.current.aspx</a> in UI thread and then compare later to non-UI synchronization context) then Debug.BitchAndMoan() about it. Any longer calculations (which "should" be all clearly separated in their own manifolds, right ;) should assert that.</p> <p>I guess you should at least make the type of execution of presenter function configurable via attribute which is then obeyed by proxy. (just in case you want something done in serial fashion).</p> <p>Canceling a task is actually presenter's problem, but you must have a reference object that tells what you want to stop. If you go the proxy way, then you could pick up created threads into task-list with IAsyncResult's, but it is still a problem to decide which one is supposed to be canceled if same action is allowed to be called multiple times in parallel. So you must supply the task with a suitable call-specific name when you start it; which implies way too much logic into View side -> Presenter should probably ask View to ask user which one of the tasks should be disposed of.</p> <p>My experience is that this is usually just worked around by using events (SCSF style). If doing it from scratch, I'd go the proxy way since SCSF has been a pain in so many ways that I doubt its designers' sanity.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload