| | 1 | | namespace LGDXRobotCloud.API.Services.Common; |
| | 2 | |
|
| | 3 | | public interface IEventService |
| | 4 | | { |
| | 5 | | event EventHandler AutoTaskCreated; |
| | 6 | | void AutoTaskHasCreated(); |
| | 7 | |
|
| | 8 | | event EventHandler<Guid> RobotCommandsUpdated; |
| | 9 | | void RobotCommandsHasUpdated(Guid robotId); |
| | 10 | |
|
| | 11 | | event EventHandler<Guid> RobotHasNextTask; |
| | 12 | | void RobotHasNextTaskTriggered(Guid robotId); |
| | 13 | | } |
| | 14 | |
|
| | 15 | | public class EventService : IEventService |
| | 16 | | { |
| | 17 | | public event EventHandler? AutoTaskCreated; |
| | 18 | | public void AutoTaskHasCreated() |
| 0 | 19 | | { |
| 0 | 20 | | AutoTaskCreated?.Invoke(this, EventArgs.Empty); |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public event EventHandler<Guid>? RobotCommandsUpdated; |
| | 24 | | public void RobotCommandsHasUpdated(Guid robotId) |
| 0 | 25 | | { |
| 0 | 26 | | RobotCommandsUpdated?.Invoke(this, robotId); |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | public event EventHandler<Guid>? RobotHasNextTask; |
| | 30 | | public void RobotHasNextTaskTriggered(Guid robotId) |
| 0 | 31 | | { |
| 0 | 32 | | RobotHasNextTask?.Invoke(this, robotId); |
| 0 | 33 | | } |
| | 34 | | } |