
void OnCompleted(object sender, RunWorkerCompletedEventArgs
completedArgs)
{
//If there was an error, notify the user.
if(completedArgs.Error != null)
{
MessageBox.Show(completedArgs.Error.Message,
completedArgs.Error.Source);
}
else
{
// The processing completed successfully.
MessageBox.Show(“ Processing has been completed. “);
}
//Execution of the command has completed, close the connection
//and reset all buttons.
if (null != this.server && this.server.Connected)
{
//Unsubscribe from the trace events, stop tracing.
if (this.server.SessionTrace != null)
{
//Here we need to wait until all the trace events have
//been retrieved.
Thread.Sleep(500);
UnsubscribeToSessionTrace(); ...