92 lines
3.2 KiB
C#
92 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace UCS.Stentofon
|
|
{
|
|
public class ACDPEvents
|
|
{
|
|
public delegate void GetDevice();
|
|
public delegate void ResetDevice();
|
|
public delegate void Ping();
|
|
public delegate void StationBusyBroadcast(string station);
|
|
public delegate void StationFreeBroadcast(string station);
|
|
public delegate void CallStatusBroadcast(string stationA, string stationB);
|
|
public delegate void ConnectionStatusBroadcast(string stationA, string stationB);
|
|
public delegate void DisconnectionStatusBroadcast(string stationA, string stationB);
|
|
public delegate void QElemAdded(string receivingStation, string sendingStation, string messageText);
|
|
public delegate void QElemRemoved(string receivingStation);
|
|
public delegate void PutString(string message);
|
|
|
|
// Declaring the Events
|
|
public event GetDevice GetDeviceEvent;
|
|
public event ResetDevice ResetDeviceEvent;
|
|
public event Ping PingEvent;
|
|
public event StationBusyBroadcast StationBusyBroadcastEvent;
|
|
public event StationFreeBroadcast StationFreeBroadcastEvent;
|
|
public event CallStatusBroadcast CallStatusBroadcastEvent;
|
|
public event ConnectionStatusBroadcast ConnectionStatusBroadcastEvent;
|
|
public event DisconnectionStatusBroadcast DiconnectionStatusBroadcastEvent;
|
|
public event QElemAdded QElemAddedEvent;
|
|
public event QElemRemoved QElemRemovedEvent;
|
|
public event PutString PutStringEvent;
|
|
|
|
// Handle this Instance as a Singelton that makes this a central point where all events are executed.
|
|
private static readonly ACDPEvents instance = new ACDPEvents();
|
|
// Default Singleton Instance
|
|
public static ACDPEvents Instance
|
|
{
|
|
get { return instance; }
|
|
}
|
|
|
|
|
|
public GetDevice EventGetDevice
|
|
{
|
|
get { return GetDeviceEvent; }
|
|
}
|
|
public ResetDevice EventResetDevice
|
|
{
|
|
get { return ResetDeviceEvent; }
|
|
}
|
|
public Ping EventPing
|
|
{
|
|
get { return PingEvent; }
|
|
}
|
|
public StationBusyBroadcast EventStationBusyBroadcast
|
|
{
|
|
get { return StationBusyBroadcastEvent; }
|
|
}
|
|
public StationFreeBroadcast EventStationFreeBroadcast
|
|
{
|
|
get { return StationFreeBroadcastEvent; }
|
|
}
|
|
public CallStatusBroadcast EventCallStatusBroadcast
|
|
{
|
|
get { return CallStatusBroadcastEvent; }
|
|
}
|
|
public ConnectionStatusBroadcast EventConnectionStatusBroadcast
|
|
{
|
|
get { return ConnectionStatusBroadcastEvent; }
|
|
}
|
|
public DisconnectionStatusBroadcast EventDisconnectionStatusBroadcast
|
|
{
|
|
get { return DiconnectionStatusBroadcastEvent; }
|
|
}
|
|
public QElemAdded EventQElemAdded
|
|
{
|
|
get { return QElemAddedEvent; }
|
|
}
|
|
public QElemRemoved EventQElemRemoved
|
|
{
|
|
get { return QElemRemovedEvent; }
|
|
}
|
|
public PutString EventPutString
|
|
{
|
|
get { return PutStringEvent; }
|
|
}
|
|
|
|
}
|
|
}
|