public void AddToLog(string entry)
 {
     try
     {
         TbMain.Invoke(new Action(() => TbMain.AppendText(entry + Environment.NewLine)));
     }
     catch { }
 }
 public void WriteToConsole(string message)
 {
     if (!(TbMain.CheckAccess()))
     {
         Dispatcher.Invoke(() =>
                           WriteToConsole(message)
                           );
         return;
     }
     TbMain.AppendText(message + "\r");
     _logger.Write($"{DateTime.Now}: {message}\r\n");
 }
Exemple #3
0
        public void AddToLog(string entry)
        {
            try
            {
                TbMain.Invoke(new Action(() => TbMain.AppendText(entry + Environment.NewLine)));
            }
            catch { }


            using (var sw = File.AppendText("log.txt"))
            {
                sw.WriteLine(entry);
            }
        }