Esempio n. 1
0
 private void WebWatcherOnLogEntry(string text, int level)
 {
     Dispatcher.Invoke(new ThreadStart(delegate
     {
         LogBox.AppendParagraph(text.WrapTimeStamp(), ColorUtils.GetColorFromLevel(level));
     }));
 }
Esempio n. 2
0
 private void WebWatcherOnNewFound(string text, int level)
 {
     Dispatcher.Invoke(new ThreadStart(delegate
     {
         SendToast(text);
         TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Indeterminate;
         LogBox.AppendParagraph(text.WrapTimeStamp(), ColorUtils.GetColorFromLevel(level));
     }));
 }
Esempio n. 3
0
 private async void TelegramLogWorker()
 {
     while (!_windowClosing)
     {
         if (_logQueue.Count > 0)
         {
             var t = _logQueue.Dequeue();
             LogBox.AppendParagraph(t, Colors.Aquamarine);
             if (LogBox.Document.Blocks.Count > 200)
             {
                 var toRemove = LogBox.Document.Blocks.ElementAt(0);
                 LogBox.Document.Blocks.Remove(toRemove);
             }
             LogBox.ScrollToEnd();
         }
         await Task.Delay(10);
     }
 }