tijian_jichuang/Code/SOH.JianYan.YiQi.Base/baseMain.cs

101 lines
2.7 KiB
C#
Raw Normal View History

2025-02-20 11:54:48 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SOH.JianYan.YiQi.Base
{
public partial class baseMain : Form
{
/// <summary>
/// 正文开始
/// </summary>
protected const char STX = (char)2;
/// <summary>
/// 正文结束
/// </summary>
protected const char ETX = (char)3;
public baseMain()
{
InitializeComponent();
}
// bool exit = false;
private void tsm_tc_Click(object sender, EventArgs e)
{
if (MessageBox.Show("你确定要退出解码程序吗?这样可能不会及时收到检验结果!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
{
//exit = true;
Application.Exit();
}
}
private void tsm_showmain_Click(object sender, EventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
}
private void baseMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
}
}
private void tsm_yc_Click(object sender, EventArgs e)
{
this.Hide();
}
private void tsm_jbsz_Click(object sender, EventArgs e)
{
frmBaseSetting bs = new frmBaseSetting();
bs.ShowDialog();
}
private void baseMain_Load(object sender, EventArgs e)
{
try
{
System.Configuration.Configuration conf = System.Configuration.ConfigurationManager.OpenExeConfiguration(Application.StartupPath + "\\local.ext");
var autodec = conf.AppSettings.Settings["autodec"];
var autodectime = conf.AppSettings.Settings["autodectime"];
if (autodec != null)
{
if (autodec.Value == "1")
{
timer1.Interval = int.Parse(autodectime.Value) * 1000;
timer1.Enabled = true;
}
else
{
timer1.Enabled = false;
}
}
}
catch
{ }
}
private void timer1_Tick(object sender, EventArgs e)
{
decoder();
}
protected virtual void decoder()
{
//throw new NotImplementedException();
}
}
}