2013-01-18 15:55:50 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2015-01-03 15:37:29 +00:00
|
|
|
using AsterNET.Manager.Event;
|
|
|
|
using AsterNET.Manager.Response;
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2014-01-08 14:16:39 +00:00
|
|
|
namespace AsterNET.Manager
|
2013-01-18 15:55:50 +00:00
|
|
|
{
|
2015-01-03 15:37:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Collection of ResponseEvent. Use in events generation actions.
|
|
|
|
/// </summary>
|
|
|
|
public class ResponseEvents
|
|
|
|
{
|
|
|
|
private readonly List<ResponseEvent> events;
|
|
|
|
|
2018-09-02 18:35:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new <see cref="ResponseEvents"/>.
|
|
|
|
/// </summary>
|
2015-01-03 15:37:29 +00:00
|
|
|
public ResponseEvents()
|
|
|
|
{
|
|
|
|
events = new List<ResponseEvent>();
|
|
|
|
Complete = false;
|
|
|
|
}
|
|
|
|
|
2018-09-02 18:35:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the response.
|
|
|
|
/// </summary>
|
2015-01-03 15:37:29 +00:00
|
|
|
public ManagerResponse Response { get; set; }
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2018-09-02 18:35:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the list of events.
|
|
|
|
/// </summary>
|
2015-01-03 15:37:29 +00:00
|
|
|
public List<ResponseEvent> Events
|
|
|
|
{
|
|
|
|
get { return events; }
|
|
|
|
}
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
/// <summary>
|
2018-09-02 18:35:20 +00:00
|
|
|
/// Indicates if all events have been received.
|
2015-01-03 15:37:29 +00:00
|
|
|
/// </summary>
|
|
|
|
public bool Complete { get; set; }
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Adds a ResponseEvent that has been received.
|
|
|
|
/// </summary>
|
2018-09-02 18:35:20 +00:00
|
|
|
/// <param name="e"><see cref="ResponseEvent"/></param>
|
2015-01-03 15:37:29 +00:00
|
|
|
public void AddEvent(ResponseEvent e)
|
|
|
|
{
|
|
|
|
lock (((IList) events).SyncRoot)
|
|
|
|
{
|
|
|
|
events.Add(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-18 15:55:50 +00:00
|
|
|
}
|