internal static SecurityActivityHistory GetHistory()
        {
            SecurityActivityHistory result;
            var list = new List <SecurityActivityHistoryItem>(_history.Length);

            lock (_lock)
            {
                for (var i = _position; i < _history.Length; i++)
                {
                    if (_history[i] != null)
                    {
                        list.Add(_history[i]);
                    }
                }
                for (var i = 0; i < _position; i++)
                {
                    if (_history[i] != null)
                    {
                        list.Add(_history[i]);
                    }
                }

                result = new SecurityActivityHistory
                {
                    State  = SecurityActivityQueue.GetCurrentState(),
                    Recent = list.ToArray()
                };
            }
            return(result);
        }
        internal static SecurityActivityHistory Reset()
        {
            SecurityActivityHistory result;

            lock (_lock)
            {
                for (var i = 0; i < _history.Length; i++)
                {
                    _history[i] = null;
                }

                _position   = 0;
                _unfinished = 0;

                result = new SecurityActivityHistory
                {
                    State  = SecurityActivityQueue.GetCurrentState(),
                    Recent = new SecurityActivityHistoryItem[0]
                };
            }
            return(result);
        }