1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-29 01:00:13 +00:00
msfs-popout-panel-manager/Shared/Logger.cs

39 lines
960 B
C#
Raw Normal View History

2021-12-14 05:40:07 +00:00
using System;
namespace MSFSPopoutPanelManager.Shared
{
public class Logger
{
public static event EventHandler<EventArgs<StatusMessage>> OnStatusLogged;
2022-01-27 13:40:04 +00:00
public static void LogStatus(string message, StatusMessageType MessageType)
2021-12-14 05:40:07 +00:00
{
var statusMessage = new StatusMessage() { Message = message, MessageType = MessageType };
OnStatusLogged?.Invoke(null, new EventArgs<StatusMessage>(statusMessage));
}
public static void ClearStatus()
{
2022-01-27 13:40:04 +00:00
LogStatus(String.Empty, StatusMessageType.Info);
2021-12-14 05:40:07 +00:00
}
}
public class StatusMessage
{
public string Message { get; set; }
public StatusMessageType MessageType { get; set; }
}
public enum StatusMessageType
{
Info,
Error
}
2022-01-27 13:40:04 +00:00
public class PopoutManagerException : Exception
2021-12-14 05:40:07 +00:00
{
public PopoutManagerException(string message) : base(message) { }
}
}