You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Components;
using PrintBarCode.Business;
using PrintBarCode.Helper;
using PrintBarCode.Model;
using SlnMesnac.Redis;
using static PrintBarCode.MessageClient;
namespace PrintBarCode
{
public partial class MainForm : Form
{
public MainForm()
{
MessageClient.addLogEvent += addLog;
InitializeComponent();
addLog("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>......");
}
private void addLog(string logInfo)
{
try
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>̲߳<DFB3><CCB2>Ǵ<EFBFBD><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣߳<DFB3>ʹ<EFBFBD><CAB9> Invoke
if (this.logList.InvokeRequired)
{
this.logList.Invoke(new Action<string>(addLog), logInfo);
}
else
{
this.logList.Items.Add($"{DateTime.Now}==>{logInfo}");
}
}
catch (Exception ex)
{
}
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
// ȡ<><C8A1><EFBFBD>رղ<D8B1><D5B2><EFBFBD>
e.Cancel = true;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>С<EFBFBD><D0A1>
this.WindowState = FormWindowState.Minimized;
}
}
}