Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RecordingManager"/> class.
        /// </summary>
        /// <param name="storage">The storage.</param>
        public DefaultRecorder(IStorage storage)
        {
            this.storage = storage;

            var calls = storage.Load();

            this.IsRecording   = calls == null;
            this.recordedCalls = CreateCallsList(calls);
        }
Example #2
0
        private static CallQueue CreateCallsList(IEnumerable <CallMetadata> callsFromStorage)
        {
            if (callsFromStorage == null)
            {
                return(new CallQueue());
            }

            var result = new CallQueue();

            foreach (var call in callsFromStorage)
            {
                result.AddItem(call);
            }

            return(result);
        }