mirror of
https://github.com/Dongyifengs/AssetStudio-Genshin-MoYi.git
synced 2025-05-06 11:29:18 +08:00
35 lines
792 B
C#
35 lines
792 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 string Log(LoggerEvent loggerEvent, string message)
|
|
{
|
|
switch (loggerEvent)
|
|
{
|
|
case LoggerEvent.Error:
|
|
if (ShowErrorMessage)
|
|
{
|
|
MessageBox.Show(message);
|
|
}
|
|
break;
|
|
default:
|
|
action(message);
|
|
break;
|
|
}
|
|
return message;
|
|
}
|
|
}
|
|
}
|