private void WindowClosing(object sender, CancelEventArgs e)
 {
     if (!_cacheCleared)
     {
         _closePending = true;
         e.Cancel      = true;
         var clearCache = new BackgroundWorker();
         clearCache.DoWork             += (o, args) => CacheTools.ClearApiCache();
         clearCache.RunWorkerCompleted += (o, args) =>
         {
             _cacheCleared = true;
             if (_closePending)
             {
                 Close();
             }
         };
         clearCache.RunWorkerAsync();
     }
 }
 private void TbStatusMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     CacheTools.ClearMarketLogs(_logdir);
     UpdateStatus();
 }