|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
private DebugConfig debugConfig = DebugConfig.Instance;
|
|
|
|
|
|
|
|
|
|
public MainForm()
|
|
|
|
|
{
|
|
|
|
|
MessageClient.addLogEvent += addLog;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
addLog("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>......");
|
|
|
|
|
|
|
|
|
|
BlankFlag.Text = debugConfig.BlankFlag=="1"?"<22><>":"<22><>";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
debugConfig.BlankFlag = debugConfig.BlankFlag == "1" ? "0" : "1";
|
|
|
|
|
BlankFlag.Text = debugConfig.BlankFlag == "1" ? "<22><>" : "<22><>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|