1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/Model/IConnection.cs

47 lines
962 B
C#
Raw Normal View History

2016-06-18 18:30:12 +00:00
using System;
namespace PettingZoo.Model
2016-06-18 14:50:32 +00:00
{
public enum ConnectionStatus
{
Disconnected,
Connecting,
Connected,
Error
}
public class StatusChangedEventArgs : EventArgs
{
public ConnectionStatus Status { get; private set; }
public string Context { get; private set; }
public StatusChangedEventArgs(ConnectionStatus status, string context)
{
Status = status;
Context = context;
}
}
2016-06-20 10:30:03 +00:00
public class MessageReceivedEventArgs : EventArgs
{
public MessageInfo MessageInfo { get; private set; }
public MessageReceivedEventArgs(MessageInfo messageInfo)
{
MessageInfo = messageInfo;
}
}
2016-06-18 18:30:12 +00:00
public interface IConnection : IDisposable
2016-06-18 14:50:32 +00:00
{
event EventHandler<StatusChangedEventArgs> StatusChanged;
2016-06-20 10:30:03 +00:00
event EventHandler<MessageReceivedEventArgs> MessageReceived;
2016-06-18 14:50:32 +00:00
}
}