I have a program that tests DB tables. As these tests can take up to several minutes, I want to outsource them into other threads, to at least give the user to possibility to abort them/exit the application.
It's not intended that the user can execute several tests at a time, so I actually only need the main thread in which the Windows Form is running and a single worker thread that performs the test.
My main problem is that I run the test table by table in a loop and each time a table has finished testing, several dictionaries and controls are updated.
When the tests is performed by another thread, it means that the user can access the same dictionaries the testing thread is updating.
So far I just tried to get the testing thread running and allow the user to abort it but I didn't have much success yet.
I used the Windows Forms Invoke Method but that doesn't seem to help much, as the GUI still doesn't respond until the test is finished.
Could you tell me what approach would be best?
Should I use a ParameterizedThreadStart that gets passed a list of all dictionaries?
And how would I go about updating the Windows Forms controls? Create some event that is fired when a table has finished testing?
I've tried it and it seems the BackgroundWorker is indeed a good solution.
It's just a hassle, because during the test the worker thread needs to access a variety of lists and update several controls on the form.
I'm using ArrayLists as arguments to provide data for the worker thread and send the results of it to the form.
It's a bit awkward as I have to cast not only the argument object but also the content, is there any better solution that is more type safe?
Please stop posting the same question. You've asked the same question 3 times in the last 24 hours, and have ignored the replies you already had. I suggest you revisit your earlier[^] questions, rather than opening up new ones.
Deja View - the feeling that you've seen this post before.
I have to put a checkbox in a DateTimePicker. My idea is whenever I check the checkbox the datetimepicker will be activited and will be disabled otherwise. if anybody knows the solution plz help me out. thanks
The easiest IDE to do it in would be visual studio 2008 (There's a free express edition), and using WPF.
mono doesn't support WPF yet though, so might not be any good for you.
I'm assuming then that you're talking about a win-forms app. Any IDE will do for this (think VS2008 is probably still the best), But it's going to be a lot of manual/owner drawn controls, it's not the easiest thing in the world to do. It's certainly not do-able just by pointing and clicking your way through it. Probably best to look for some 3rd party skinable control library.
Well if you have to do the work in UNIX just pick one of those IDEs, they're all gonna give you about the same levels of support I would assume. A media player like interface is going to pretty much have to be all owner drawn, so you're going to spend a lot of your time writing graphics code to draw all the pretty shapes.
There isn't a simple point and click interface for this kind of custom fancy stuff.
That or find a 3rd party control library that works on mono, and has skinable controls.
the array pathsList holds the full path of the files
the array filesList hold the abstract names of the files
As you see in the code, in the loop I update only the filesList
The MAGIC is, the pathsList is updated too
Can any why tell me how this happens?
foreach(Minute m in MyLife)