public static void Log(LogType logType, string text)
{
if (text == "") return;
Instance.Dispatcher.Invoke((MethodInvoker) delegate
{
switch (logType)
{
case LogType.Log:
Instance.rtbLog.AppendText(text);
Instance.rtbLog.ScrollToEnd();
break;
case LogType.Debug:
Instance.rtbDebug.AppendText(text);
Instance.rtbDebug.ScrollToEnd();
break;
case LogType.Combat:
Instance.rtbCombatLog.AppendText(text);
Instance.rtbCombatLog.ScrollToEnd();
break;
case LogType.Navigation:
Instance.rtbNavigationLog.AppendText(text);
Instance.rtbNavigationLog.ScrollToEnd();
break;
default:
throw new ArgumentOutOfRangeException("logType");
}
},
DispatcherPriority.Background);
}