Click here to Skip to main content
16,010,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
MacRaider410-Feb-11 9:03
MacRaider410-Feb-11 9:03 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
MacRaider410-Feb-11 9:22
MacRaider410-Feb-11 9:22 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
PIEBALDconsult10-Feb-11 9:54
mvePIEBALDconsult10-Feb-11 9:54 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
MacRaider411-Feb-11 1:27
MacRaider411-Feb-11 1:27 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
PIEBALDconsult11-Feb-11 2:01
mvePIEBALDconsult11-Feb-11 2:01 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
MacRaider411-Feb-11 2:42
MacRaider411-Feb-11 2:42 
GeneralRe: Can you run the same function from two backgroundWorkers Pin
PIEBALDconsult11-Feb-11 7:19
mvePIEBALDconsult11-Feb-11 7:19 
GeneralRe: Can you run the same function from two backgroundWorkers [modified] Pin
MacRaider411-Feb-11 7:27
MacRaider411-Feb-11 7:27 
Still can't get my 3rd worker to "work" as I'm still getting the backgroundWorker3 does not exist in the current context in the first occurance of each line in InitializeBackgroundWorker3. So that's putting a hinderance on everything.

public Form1()
        {
            InitializeComponent();
            InitializeBackgroundWorker();
            InitializeBackgroundWorker2();
            InitializeBackgroundWorker3();

            btnGetMessageInfo.Enabled = false;
            btnCancelConnection.Enabled = false;

        }
        private void InitializeBackgroundWorker()
        {
            backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
            backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker3_ProgressChanged);
        }

        private void InitializeBackgroundWorker2()
        {
            backgroundWorker2.DoWork += new DoWorkEventHandler(backgroundWorker2_DoWork);
            backgroundWorker2.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker2_RunWorkerCompleted);
            backgroundWorker2.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker2_ProgressChanged);
        }

        private void InitializeBackgroundWorker3()
        {
            backgroundWorker3.DoWork += new DoWorkEventHandler(backgroundWorker3_DoWork);
            backgroundWorker3.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker3_RunWorkerCompleted);
            backgroundWorker3.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker3_ProgressChanged);
        }

So what I have now is when you click on the connect button (first thing you can do), it logs into the server and gets the total number and size of each message. And stores that in a global variable and displays some info on the form.
Then it figures out how many workers to use (based on number of messages)and assigns start and end values for each worker.
I'm now in the process of writing the work for the workers (focusing on 1 and 2 since only those work).

It's moving along, though slowly.

modified on Friday, February 11, 2011 1:33 PM

QuestionTwo way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 3:58
mveRichard MacCutchan10-Feb-11 3:58 
AnswerRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 4:16
professionalEddy Vluggen10-Feb-11 4:16 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 4:27
mveRichard MacCutchan10-Feb-11 4:27 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 4:52
professionalEddy Vluggen10-Feb-11 4:52 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 5:09
mveRichard MacCutchan10-Feb-11 5:09 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 7:16
professionalEddy Vluggen10-Feb-11 7:16 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 10:23
mveRichard MacCutchan10-Feb-11 10:23 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Henry Minute10-Feb-11 13:06
Henry Minute10-Feb-11 13:06 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan11-Feb-11 4:08
mveRichard MacCutchan11-Feb-11 4:08 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Henry Minute11-Feb-11 8:28
Henry Minute11-Feb-11 8:28 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan12-Feb-11 3:09
mveRichard MacCutchan12-Feb-11 3:09 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan13-Feb-11 1:40
mveRichard MacCutchan13-Feb-11 1:40 
QuestionHow to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 1:54
professionalChesnokov Yuriy10-Feb-11 1:54 
AnswerRe: How to localize BackgroundWorker thread? Pin
Pete O'Hanlon10-Feb-11 2:05
mvePete O'Hanlon10-Feb-11 2:05 
AnswerRe: How to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 2:29
professionalChesnokov Yuriy10-Feb-11 2:29 
AnswerRe: How to localize BackgroundWorker thread? Pin
Bernhard Hiller10-Feb-11 5:04
Bernhard Hiller10-Feb-11 5:04 
QuestionRe: How to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 6:27
professionalChesnokov Yuriy10-Feb-11 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.