diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging')
2 files changed, 16 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index b4015b297..0f19d3b6d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -35,6 +35,15 @@ namespace Tango.MachineStudio.Common.EventLogging private String _hostName; private bool _isInitialized; + #region Events + + /// <summary> + /// Occurs when a new machine event has been logged. + /// </summary> + public event EventHandler<MachinesEvent> NewLog; + + #endregion + #region Constructors /// <summary> @@ -174,6 +183,8 @@ namespace Tango.MachineStudio.Common.EventLogging LogManager.Log("Logging event " + machineEvent.EventType.Name + " - " + machineEvent.Description); _events.Enqueue(machineEvent); + + NewLog?.Invoke(this, machineEvent); } /// <summary> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs index bafdca914..aeecb4ae6 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs @@ -15,6 +15,11 @@ namespace Tango.MachineStudio.Common.EventLogging public interface IEventLogger { /// <summary> + /// Occurs when a new machine event has been logged. + /// </summary> + event EventHandler<MachinesEvent> NewLog; + + /// <summary> /// Logs the specified machine event. /// </summary> /// <param name="machineEvent">The machine event.</param> |
