public void AddLog(string message, TaskLogType type) { Dispatcher.Invoke(() => { if (mainTabControl.SelectedIndex != 0) { mainTabControl.SelectedIndex = 0; } TaskLogManager.AddLog(message, type); ScrollToEnd(); }); }
public static void AddLog(string message, TaskLogType type) { OnLogAdded(new TaskLog() { DateTime = DateTime.Now, LogType = type, Message = message }); sw.WriteLine($"[{DateTime.Now.ToString("MM/dd HH:mm:ss")}] [{type.GetAttributeFromEnum<DescriptionAttribute>().Description}] {message}"); sw.Flush(); }