protected virtual void OnNewLogMessage(string logMessage)
 {
     LogMessageAdded?.Invoke(this, new LogMessageEventArgs()
     {
         Message = logMessage
     });
 }
Exemplo n.º 2
0
        public static void AppendLine(string text, MessageType type = MessageType.None)
        {
            LogText +=
                $"[{DateTime.Now:HH:mm:ss.ff}] " +
                $"{(type == MessageType.None ? "" : $"[{Enum.GetName(typeof(MessageType), type)}]")} " +
                $"{text}" + Environment.NewLine;

            LogMessageAdded?.Invoke(null, new MessageAddedEventArgs(text, type));
        }
Exemplo n.º 3
0
 private void Log(string message)
 {
     lock (Lock)
     {
         message = "[" + DateTime.Now.ToString("HH:mm") + "] " + message;
         File.AppendAllText(_logFilePath, Environment.NewLine + message);
         LogMessageAdded?.Invoke(this, message);
     }
 }
Exemplo n.º 4
0
 protected virtual void OnLogMessageAdded(LogMessageAddedEventArgs e)
 {
     LogMessageAdded?.Invoke(this, e);
 }
Exemplo n.º 5
0
 private static void RaiseLogMessageAdded(string message, bool isShow)
 {
     LogMessageAdded?.Invoke(null, new LogMessageAddedEventArgs(message, isShow));
 }