mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-22 22:00:11 +00:00
45 lines
1.1 KiB
C#
45 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
|
|||
|
}
|
|||
|
}
|