S
sjoshi
I have a derived class OraBackup which has a method that calls stored
procedure on Oracledb to get status of backup job.
Now the base class publishes an event like this:
public delegate void PercentEventHandler(object sender,
JobCompletedEventArgs e);
public event PercentEventHandler PercentCompleted;
And fires it:
protected void OnPercentCompletion(JobCompletedEventArgs e)
{
if (PercentCompleted != null)
PercentCompleted(this, e);
}
to report progress to UI.
Since I have to keep calling the method in OraBackup to check the
progress, I was wondering what would be the best way to do this in the
derived OraBackup class:
public void CheckProgress()
{
string jobStatus;
int percent = _oraGateway.GetProgress(jobName, out jobStatus)
//Fire event
OnPercentCompletion(new JobCompletedEventArgs(percent);
//I need to keep firing until the jobStatus is "COMPLETED" or
"STOPPED";
}
thanks
Sunit
procedure on Oracledb to get status of backup job.
Now the base class publishes an event like this:
public delegate void PercentEventHandler(object sender,
JobCompletedEventArgs e);
public event PercentEventHandler PercentCompleted;
And fires it:
protected void OnPercentCompletion(JobCompletedEventArgs e)
{
if (PercentCompleted != null)
PercentCompleted(this, e);
}
to report progress to UI.
Since I have to keep calling the method in OraBackup to check the
progress, I was wondering what would be the best way to do this in the
derived OraBackup class:
public void CheckProgress()
{
string jobStatus;
int percent = _oraGateway.GetProgress(jobName, out jobStatus)
//Fire event
OnPercentCompletion(new JobCompletedEventArgs(percent);
//I need to keep firing until the jobStatus is "COMPLETED" or
"STOPPED";
}
thanks
Sunit