void bw_Completed( object sender, RunWorkerCompletedEventArgs e )
{
if( e.Error != null )
{
_currentOperation.SetStatus( LoadOperationStatus.Failed );
}
else if( e.Cancelled )
{
_currentOperation.SetStatus( LoadOperationStatus.Cancelled );
_pendingOperations.Clear();
}
if( _currentOperation.OnOperationCompleted != null )
_currentOperation.OnOperationCompleted( _currentOperation );
if( _pendingOperations.Count > 0 )
{
_currentOperation = _pendingOperations.Dequeue();
_currentOperation.OperationWillStart();
_bw.RunWorkerAsync( _currentOperation );
}
else
{
_bw = null;
_currentOperation = null;
}
}