public void Reset() { _disposed = true; try { SetToSleep(); _sleepTileCacheManager.Clear(); CreateTileLoadWorker(); } finally { _disposed = false; } }
void SetToSleep() { _loadStack.Clear(); while (_isNotifyRefreshing) { Thread.Sleep(10); } while (_loadWorker.IsBusy && _loadStack.Count > 0) { Thread.Sleep(10); } _loadWorker.Dispose(); _tileCacheManager.Clear(); _canvas.OnEnvelopeChanged -= _canvasEnvelopeChanged; }
void SetToSleep() { _loadStack.Clear(); while (_isNotifyRefreshing) { Thread.Sleep(10); } if (_loadWorkerIsStarted) { while (!_loadWorkerIsCompleted) { Thread.Sleep(10); } _loadWorker.Dispose(); _loadWorkerIsStarted = false; } _tileCacheManager.Clear(); _totalTileCount = 0; _loadedTitleCount = 0; _canvas.OnEnvelopeChanged -= _canvasEnvelopeChanged; }