lixiaojun
2024-06-18 15a52eea9c8d055ce120037f90dcb1904ed81fa5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
 
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.Properties.Settings.Default.CloseStatus = "CLOSE";
                }
                else
                {
                    HStation.Desktop.Properties.Settings.Default.CloseStatus = "NOTIFY";
                }
                HStation.Desktop.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()
        {
 
        }
    }
}