internal AWSCmdletHistory(string cmdletName)
 {
     this.CmdletName          = cmdletName;
     Requests                 = new HistoryBuffer <PSObject>(AWSCmdletHistoryBuffer.Instance.ServiceCallHistoryLength);
     Responses                = new HistoryBuffer <PSObject>(AWSCmdletHistoryBuffer.Instance.ServiceCallHistoryLength);
     this.EmittedObjectsCount = 0;
     this.CmdletEnd           = this.CmdletStart = DateTime.Now;
 }
        public HistoryBuffer(int maxLength, HistoryBuffer <T> currentBuffer)
        {
            _queue = new Queue <T>(maxLength);
            int oldestToCopy = maxLength > currentBuffer.Count ? 0 : currentBuffer.Count - maxLength;

            for (int i = oldestToCopy; i < currentBuffer.Count; i++)
            {
                _queue.Enqueue(currentBuffer._queue.ElementAt <T>(i));
            }

            _maxLength = maxLength;
        }
 private AWSCmdletHistoryBuffer()
 {
     History = new HistoryBuffer <AWSCmdletHistory>(_historyLength);
 }