Exemple #1
0
 private void ClearLog()
 {
     Invoke((MethodInvoker) delegate()
     {
         RichTextBox_Log.Clear();
         Label_LogCounter.Text = $"Лог[0]";
     });
 }
Exemple #2
0
        private void SendLog(string log, int threadCount = -1)
        {
            string threadInfo = "";

            if (threadCount != -1)
            {
                threadInfo = $"[Поток№{threadCount}]";
            }

            Invoke((MethodInvoker) delegate()
            {
                RichTextBox_Log.AppendText($"{Globals.System.Time}{threadInfo}{log}" + Environment.NewLine);
                Label_LogCounter.Text = $"Лог[{RichTextBox_Log.Lines.Count() - 1}]";
                RichTextBox_Log.ScrollToCaret();
            });
        }
 private void RichTextBox_Log_TextChanged(object sender, EventArgs e)
 {
     RichTextBox_Log.SelectionStart  = RichTextBox_Log.TextLength;
     RichTextBox_Log.SelectionLength = 0;
     RichTextBox_Log.ScrollToCaret();
 }