프로젝트

일반

사용자정보

통계
| 개정판:

hytos / DTI_PID / ID2PSN / Form / TieInSetting.cs @ e75b5c63

이력 | 보기 | 이력해설 | 다운로드 (2.61 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9
using System.Windows.Forms;
10
using System.IO;
11
using DevExpress.XtraEditors.Repository;
12
using DevExpress.XtraGrid.Columns;
13
using DevExpress.XtraGrid;
14
using DevExpress.XtraGrid.Views.Grid;
15
using DevExpress.Utils.StructuredStorage.Internal.Reader;
16
using DevExpress.XtraTreeList;
17
using DevExpress.XtraTreeList.Columns;
18
using DevExpress.XtraTreeList.Nodes;
19
using DevExpress.Utils.Extensions;
20
using DevExpress.Utils;
21
using DevExpress.Utils.Drawing;
22

    
23
namespace ID2PSN
24
{
25
    public partial class TieInSetting : DevExpress.XtraBars.Ribbon.RibbonForm
26
    {
27
        ID2Info ID2Info = ID2Info.GetInstance();
28

    
29
        public TieInSetting()
30
        {
31
            InitializeComponent();
32

    
33
            comboBoxTieIn.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
34
            string equipTag = Properties.Settings.Default.TieInAttribute;
35
            DataTable dt = DB.SelectTieInSymbolAttribute();
36
            foreach (DataRow row in dt.Rows)
37
            {
38
                string value = row["Attribute"].ToString();
39
                comboBoxTieIn.Properties.Items.Add(value);
40
                if (!string.IsNullOrEmpty(equipTag) && value.Equals(equipTag))
41
                    comboBoxTieIn.SelectedItem = value;
42
            }
43

    
44
            checkTieIn.Checked = Properties.Settings.Default.UseTieIn;
45
            comboBoxTieIn.Enabled = checkTieIn.Checked;
46

    
47
        }
48
      
49
        private void btnSave_Click(object sender, EventArgs e)
50
        {
51
            try
52
            {
53
                //if (checkTieIn.Checked)
54
                //{
55
                    Properties.Settings.Default.TieInAttribute = comboBoxTieIn.SelectedItem.ToString();                   
56
                //}
57
                Properties.Settings.Default.UseTieIn = checkTieIn.Checked;
58
                Properties.Settings.Default.Save();
59
                MessageBox.Show("Save was successful", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information);
60
            }
61
           catch(Exception ex)
62
            {
63
                MessageBox.Show("Failed to save", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
64
            }                
65
        }
66

    
67
        private void check_CheckedChanged(object sender, EventArgs e)
68
        {
69
            comboBoxTieIn.Enabled = checkTieIn.Checked;
70
        }
71

    
72
        private void btnClose_Click(object sender, EventArgs e)
73
        {
74
            DialogResult = DialogResult.Cancel;
75
        }
76
    }
77
}
클립보드 이미지 추가 (최대 크기: 500 MB)