Exemplo n.º 1
0
 public void Log_NewMessage(LogEntery logEntery)
 {
     if (logEntery.showExternal)
     {
         foreach (string line in logEntery.GetTextAsArray())
         {
             ShowInfo(line, LogType.Normal);
         }
     }
 }
Exemplo n.º 2
0
 private static void SaveToFile(LogEntery logEntery)
 {
     // TODO: add methot to handle new day
     if (tw != null)
     {
         tw.WriteLine(string.Format("{0} [{1}] [{2}] [{3}] {4}", logEntery.dateTime.ToLongTimeString(), logEntery.logType, logEntery.from, logEntery.action, logEntery.text.Trim().Equals("") ? "" : "\r\n" + logEntery.text));
     }
 }
Exemplo n.º 3
0
 public static void Write(LogEntery logEntery)
 {
     // This call enters LogEntery directili in array, good for calling from external app
     log.Add(logEntery);
 }
Exemplo n.º 4
0
 private static void NewLogDataEvent(LogEntery logEntery)
 {
     if (activeLog != null)
     {
         activeLog.ShowLog();
     }
     if (saveLocal)
     {
         SaveToFile(logEntery);
     }
     if (NewMessage != null)
     {
         NewMessage(logEntery);
     }
     if (Log.OnLogTypeNumberChange != null)
     {
         Log.OnLogTypeNumberChange(logEntery.logType, LogTypeCounter.Increment(logEntery.logType));
     }
 }
Exemplo n.º 5
0
 public static void Write(object text, object source, string action, LogType logType, bool showExternal)
 {
     LogEntery logEntery = new LogEntery(text, source.ToString(), action, logType, showExternal);
     log.Add(logEntery);
     NewLogDataEvent(logEntery);
 }
Exemplo n.º 6
0
 public static void Write(object text, Type type, string action, LogType logType)
 {
     LogEntery logEntery = new LogEntery(text, type.ToString(), action, logType);
     log.Add(logEntery);
     NewLogDataEvent(logEntery);
 }
Exemplo n.º 7
0
 public static void Write(object text, object source, string action, LogType logType)
 {
     LogEntery logEntery = new LogEntery(text, source.GetType().ToString(), action, logType);
     log.Add(logEntery);
     NewLogDataEvent(logEntery);
 }
Exemplo n.º 8
0
 public static void Write(string text, string source, LogType logType)
 {
     LogEntery logEntery = new LogEntery(text, source, logType);
     log.Add(logEntery);
     NewLogDataEvent(logEntery);
 }
Exemplo n.º 9
0
 public static void Write(string text)
 {
     LogEntery logEntery = new LogEntery(text);
     log.Add(logEntery);
     NewLogDataEvent(logEntery);
 }