Example #1
0
        private void HandleLogStatusEvent(string texto)
        {
            try
            {
                if (!String.IsNullOrEmpty(texto))
                {
                    TxtLinhas.Text  = TxtMensagens.Lines.Length.ToString();
                    TxtTamanho.Text = TxtMensagens.Text.Length.ToString();

                    if (rbtDesce.Checked)
                    {
                        TxtMensagens.Text = DateTime.Now.Hour.ToString("00") + ":"
                                            + DateTime.Now.Minute.ToString("00") + ":"
                                            + DateTime.Now.Second.ToString("00") + ":"
                                            + DateTime.Now.Millisecond.ToString("00") + " - "
                                            + texto
                                            + Environment.NewLine
                                            + TxtMensagens.Text;
                    }
                    else if (rbtSobe.Checked)
                    {
                        TxtMensagens.Text += DateTime.Now.Hour.ToString("00") + ":"
                                             + DateTime.Now.Minute.ToString("00") + ":"
                                             + DateTime.Now.Second.ToString("00") + ":"
                                             + DateTime.Now.Millisecond.ToString("00") + " - "
                                             + texto
                                             + Environment.NewLine;

                        TxtMensagens.SelectionStart = TxtMensagens.Text.Length;
                        TxtMensagens.ScrollToCaret();
                        TxtMensagens.Refresh();
                    }
                }
                else
                {
                    TxtMensagens.Clear();
                }
            }
            catch (Exception ex)
            {
                OnLogStatus("Erro em: " + ex.Message);
            }
        }
Example #2
0
 private void BtnLimpar_Click(object sender, EventArgs e)
 {
     TxtMensagens.Clear();
     TxtLinhas.Text  = TxtMensagens.Lines.Length.ToString();
     TxtTamanho.Text = TxtMensagens.Text.Length.ToString();
 }