asternet/Asterisk.2013/Asterisk.NET/Manager/ResponseEvents.cs

55 lines
1.2 KiB
C#
Raw Normal View History

using System.Collections;
2014-01-08 14:16:39 +00:00
using AsterNET.Manager.Response;
using AsterNET.Manager.Event;
using System.Collections.Generic;
2014-01-08 14:16:39 +00:00
namespace AsterNET.Manager
{
/// <summary>
/// Collection of ResponseEvent. Use in events generation actions.
/// </summary>
public class ResponseEvents
{
private ManagerResponse response;
private List<ResponseEvent> events;
private bool complete;
public ManagerResponse Response
{
get { return this.response; }
set { this.response = value; }
}
public List<ResponseEvent> Events
{
get { return events; }
}
/// <summary>
/// Indicats if all events have been received.
/// </summary>
public bool Complete
{
get { return this.complete; }
set { this.complete = value; }
}
/// <summary> Creates a new instance.</summary>
public ResponseEvents()
{
this.events = new List<ResponseEvent>();
this.complete = false;
}
/// <summary>
/// Adds a ResponseEvent that has been received.
/// </summary>
/// <param name="e">the ResponseEvent that has been received.</param>
public void AddEvent(ResponseEvent e)
{
lock (((IList)events).SyncRoot)
{
events.Add(e);
}
}
}
}