Exemple #1
0
        private void WriteToFile(HslMessageDegree degree, string text)
        {
            //过滤事件
            if (degree <= m_messageDegree)
            {
                //需要记录数据
                HslMessageItem item = GetHslMessageItem(degree, text);

                HslEventArgs args = new HslEventArgs()
                {
                    HslMessage = item,
                };

                AddItemToCache(item);
                //触发事件
                OnBeforeSaveToFile(args);
            }
        }
Exemple #2
0
 private void OnBeforeSaveToFile(HslEventArgs args)
 {
     BeforeSaveToFile?.Invoke(this, args);
 }
 private void LogNet_BeforeSaveToFile(object sender, HslCommunication.LogNet.HslEventArgs e)
 {
     // 显示日志信息
     ShowTextInfo(e.HslMessage.ToString( ));
 }