Re: Monitoring Threads

Fabian Schmied <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <[email protected]>
> If you're sure you'll have a message pump running, then using the
> System.Windows.Forms timer will ensure the Elapsed event (if that's what
> event is fired for that timer -- can't recall) fires on the UI thread.

Yes, but this only works if the System.Windows.Forms.Timer is _added_
to a control. SWF.Timer cannot be used without control (or similar
component contrainer), can it?

> And you could always check the Application.MessageLoop property before
> doing anything and throw some kind of exception to let consumers of your
> component know that they must call your component from a UI thread.

That's true, but keep in mind there might be more than one UI thread.

Fabian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.