1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 13:50:14 +00:00
msfs-popout-panel-manager/Modules/Logger.cs
2021-10-05 17:41:38 -04:00

44 lines
1.1 KiB
C#

using System;
namespace MSFSPopoutPanelManager
{
public class Logger
{
public static event EventHandler<EventArgs<StatusMessage>> OnStatusLogged;
public static void LogStatus(string message)
{
var statusMessage = new StatusMessage() { Message = message, Priority = StatusPriority.Low };
OnStatusLogged?.Invoke(null, new EventArgs<StatusMessage>(statusMessage));
}
public static void LogStatus(string message, StatusPriority priority)
{
var statusMessage = new StatusMessage() { Message = message, Priority = priority };
OnStatusLogged?.Invoke(null, new EventArgs<StatusMessage>(statusMessage));
}
}
public class EventArgs<T> : EventArgs
{
public T Value { get; private set; }
public EventArgs(T val)
{
Value = val;
}
}
public class StatusMessage
{
public string Message { get; set; }
public StatusPriority Priority { get; set; }
}
public enum StatusPriority
{
High,
Low
}
}