C
Curious
I have two classes:
BulkProcessing.cs
BulkProcessingStatusForm.cs
BulkProcessing uses a background worker to process each row of data.
BulkProcessingStatusForm is a UI form (dialog) that displays the
status of the processing.
Now I have "DoWork" method in BulkProcessing as below:
protected void DoWork(object sender, DoWorkEventArgs args)
{
for (int i = 0; i < mSelectedItems.Count; i++)
{
try
{
//omitted code
}
catch (Exception e)
{
//error handling
}
this.mBackgroundWorker.ReportProgress(i /
mSelectedItems.Count, i);
// How to update the UI controls on the other form
(BulkProcessingStatusFormBase)?
UpdateControls();
}
}
I was advised to use RaiseEvents (to observe events from the UI form).
But I don't know how. Any advice?
BulkProcessing.cs
BulkProcessingStatusForm.cs
BulkProcessing uses a background worker to process each row of data.
BulkProcessingStatusForm is a UI form (dialog) that displays the
status of the processing.
Now I have "DoWork" method in BulkProcessing as below:
protected void DoWork(object sender, DoWorkEventArgs args)
{
for (int i = 0; i < mSelectedItems.Count; i++)
{
try
{
//omitted code
}
catch (Exception e)
{
//error handling
}
this.mBackgroundWorker.ReportProgress(i /
mSelectedItems.Count, i);
// How to update the UI controls on the other form
(BulkProcessingStatusFormBase)?
UpdateControls();
}
}
I was advised to use RaiseEvents (to observe events from the UI form).
But I don't know how. Any advice?