Files
YarikStudio/AssetStudioGUI/GUILogger.cs
2023-09-22 21:07:09 +04:00

37 lines
832 B
C#

using AssetStudio;
using System;
using System.Windows.Forms;
namespace AssetStudioGUI
{
class GUILogger : ILogger
{
public bool ShowErrorMessage = true;
private Action<string> action;
public GUILogger(Action<string> action)
{
this.action = action;
}
public void Log(LoggerEvent loggerEvent, string message, bool silent = false)
{
if (silent)
return;
switch (loggerEvent)
{
case LoggerEvent.Error:
if (ShowErrorMessage)
{
MessageBox.Show(message);
}
break;
default:
action(message);
break;
}
}
}
}