public LetterManager() { Delay = 25; _locks = new Locker[_sizeOfBox]; for (var i = 0; i < _sizeOfBox; i++) _locks[i] = new Locker(false); }
public void Run() { if (!_isRunning) { _isRunning = true; _locks = new Locker[_sizeOfBox]; for (var i = 0; i < _sizeOfBox; i++) { _locks[i] = new Locker(false); } foreach (var letter in _lettersQueue) { _locks[letter.Position].IsLocked = true; } _returningResultTimer = new Timer(RunRunner, null, 0, Delay); } }