using DevExpress.XtraEditors;
|
using System;
|
|
namespace HStation.Desktop
|
{
|
public enum CloseStatus
|
{
|
Close = 0,
|
Notify = 1,
|
Cancel = 2
|
}
|
public partial class CloseWarningCtrl : XtraUserControl
|
{
|
public CloseWarningCtrl()
|
{
|
InitializeComponent();
|
|
|
}
|
|
public CloseStatus CloseStatus = CloseStatus.Cancel;
|
private void buttonOK_Click(object sender, EventArgs e)
|
{
|
if (radioButtonMinimize.Checked)
|
CloseStatus = CloseStatus.Notify;
|
else
|
CloseStatus = CloseStatus.Close;
|
|
if (checkBox1.Checked)
|
{
|
if (CloseStatus == CloseStatus.Close)
|
{
|
HStation.Desktop.Xhs.Main.Properties.Settings.Default.CloseStatus = "CLOSE";
|
}
|
else
|
{
|
HStation.Desktop.Xhs.Main.Properties.Settings.Default.CloseStatus = "NOTIFY";
|
}
|
HStation.Desktop.Xhs.Main.Properties.Settings.Default.Save();
|
}
|
if (CloseStatus == CloseStatus.Close)
|
{
|
// if (SPump.WinFrmUI.GlobeParas.SoftUpgradeStatus == Model.eSoftUpgradeStatus.正在更新)
|
// {
|
// DialogResult result = MessageBox.Show("软件正在下载更新包, 如果此时关闭软件, 下载将终止", "询问",
|
//System.Windows.Forms.MessageBoxButtons.YesNo,
|
//System.Windows.Forms.MessageBoxIcon.Warning);
|
// if (result != DialogResult.Yes)
|
// {
|
// CloseStatus = CloseStatus.Notify;
|
// }
|
// }
|
}
|
}
|
|
private void buttonCancel_Click(object sender, EventArgs e)
|
{
|
CloseStatus = CloseStatus.Cancel;
|
}
|
|
private string _fontName = "微软雅黑";
|
private void CloseWarningCtrl_Load(object sender, EventArgs e)
|
{
|
|
this.lblInfo.Font = new System.Drawing.Font(_fontName, 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.radioButtonMinimize.Font = new System.Drawing.Font(_fontName, 14.25F);
|
this.radioButtonCloss.Font = new System.Drawing.Font(_fontName, 14.25F);
|
this.checkBox1.Font = new System.Drawing.Font(_fontName, 9F);
|
|
LocationDialog();
|
}
|
|
|
//翻译界面语言
|
private void LocationDialog()
|
{
|
|
}
|
}
|
}
|