using System.Collections; using Asterisk.NET.Manager.Response; using Asterisk.NET.Manager.Event; using System.Collections.Generic; namespace Asterisk.NET.Manager { /// /// Collection of ResponseEvent. Use in events generation actions. /// public class ResponseEvents { private ManagerResponse response; private List events; private bool complete; public ManagerResponse Response { get { return this.response; } set { this.response = value; } } public List Events { get { return events; } } /// /// Indicats if all events have been received. /// public bool Complete { get { return this.complete; } set { this.complete = value; } } /// Creates a new instance. public ResponseEvents() { this.events = new List(); this.complete = false; } /// /// Adds a ResponseEvent that has been received. /// /// the ResponseEvent that has been received. public void AddEvent(ResponseEvent e) { lock (((IList)events).SyncRoot) { events.Add(e); } } } }