private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
        {
            if (!checkBox1.Checked)
            {
                return;
            }

            try
            {
                if (InvokeRequired)
                {
                    Invoke(new Action <object, HslCommunication.LogNet.HslEventArgs>(LogNet_BeforeSaveToFile), sender, e);
                    return;
                }

                if (textBox1.TextLength > 1000_000)
                {
                    textBox1.Clear( );
                }
                textBox1.AppendText(e.HslMessage.ToString( ) + Environment.NewLine);
            }
            catch
            {
                return;
            }
        }
Пример #2
0
 private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
 {
     Invoke(new Action(() =>
     {
         textBox8.AppendText(e.HslMessage.ToString( ) + Environment.NewLine);
     }));
 }
Пример #3
0
        /// <summary>
        /// 当有日志记录的时候,触发,将日志信息也在主界面进行输出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke(new Action <object, HslCommunication.LogNet.HslEventArgs>(LogNet_BeforeSaveToFile), sender, e);
                return;
            }

            textBox1.AppendText(e.HslMessage.ToString( ) + Environment.NewLine);
        }
Пример #4
0
        private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
        {
            // 显示日志信息
            if (IsHandleCreated && InvokeRequired)
            {
                BeginInvoke(new Action <object, HslCommunication.LogNet.HslEventArgs>(LogNet_BeforeSaveToFile), sender, e);
                return;
            }

            textBox1.AppendText(FormatLogInfo(e.HslMessage));
        }
Пример #5
0
 private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
 {
     if (InvokeRequired && IsHandleCreated)
     {
         try
         {
             Invoke(actionShowMsg, e.HslMessage.ToString( ));
         }
         catch
         {
         }
     }
 }
Пример #6
0
 private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
 {
     try
     {
         Invoke(new Action(() =>
         {
             if (radioButton2.Checked)
             {
                 textBox8.AppendText(e.HslMessage.ToString( ) + Environment.NewLine);
             }
         }));
     }
     catch
     {
     }
 }
Пример #7
0
 private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
 {
     // 显示日志信息
     ShowTextInfo(e.HslMessage.ToString( ));
 }