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

45 lines
1.1 KiB
C#
Raw Normal View History

2021-09-30 02:17:20 +00:00
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
}
}