Re: Wrapping FileSystemWatcher to prevent crossthread ops
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Well, I asked for a better way. I just noticed the
..SynchronizingObject property, which can automatically marshall events
to the correct thread for any form, control, or class I choose; and
which exists for not only FileSystemWatcher, but apparently all other
WinForms components that can raise events on foreign threads.
I will console myself by saying that this was at least a good exercise.
:)
.
Relevant Pages
- RE: Need some Help JumpStart Delegates and Events in Classes
... correct thread that created the control. ... public delegate void SingleStringDelegate(string newValue); ... Connection Object provieds for an InfoMessage Event. ... (microsoft.public.dotnet.languages.csharp) - Re: Which Async. Pattern should I be using?
... the msdn docs I mentioned are here: ... are handled on the correct thread [well no errors are thrown, ... make sure you've got a Control that is associated in some specific ... that's always around and I can invoke an anonymous method using the form ... (microsoft.public.dotnet.languages.csharp) - Re: VB.NET 2005 -- Minimizing Application On Startup
... correct thread, but if the delegate ... is called asynchronously, it always post message. ... "Both BeginInvoke and Invoke check if they are called on the correct thread (the thread that created ... the control) and if so, directly update the control instead of doing the PostMessage thing." ... (microsoft.public.vsnet.general) - Re: Using the backgroundworker to populate a treeview
... "john wright" schrieb ... the backgroundworker I get an error "Action being performed on this ... control is being called from the wrong thread. ... correct thread using Control.Invoke or Control.BeginInvoke to ... (microsoft.public.dotnet.languages.vb) |
|