hytos / DTI_PID / SPPIDConverter_AutoModeling / SymbolPathForm.cs @ 6d45a000
이력 | 보기 | 이력해설 | 다운로드 (1.86 KB)
1 | aac983d3 | gaqhf | 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 DevExpress.XtraTreeList; |
||
11 | using DevExpress.XtraTreeList.Nodes; |
||
12 | |||
13 | namespace SPPIDConverter_AutoModeling |
||
14 | { |
||
15 | public partial class SymbolPathForm : DevExpress.XtraBars.Ribbon.RibbonForm |
||
16 | { |
||
17 | DataTable symbolPathDT; |
||
18 | public string FullPath { get; set; } |
||
19 | |||
20 | public SymbolPathForm(DataTable symbolPathDT) |
||
21 | { |
||
22 | InitializeComponent(); |
||
23 | this.symbolPathDT = symbolPathDT; |
||
24 | InitTreeList(); |
||
25 | } |
||
26 | |||
27 | public void InitTreeList() |
||
28 | { |
||
29 | treeList1.DataSource = symbolPathDT; |
||
30 | treeList1.KeyFieldName = "ID"; |
||
31 | treeList1.ParentFieldName = "Parent"; |
||
32 | treeList1.OptionsView.ShowIndicator = false; |
||
33 | treeList1.OptionsView.ShowColumns = false; |
||
34 | treeList1.OptionsView.ShowHorzLines = false; |
||
35 | treeList1.OptionsView.ShowVertLines = false; |
||
36 | treeList1.OptionsView.FocusRectStyle = DrawFocusRectStyle.None; |
||
37 | treeList1.OptionsBehavior.Editable = false; |
||
38 | treeList1.Columns["FullPath"].Visible = false; |
||
39 | treeList1.ExpandToLevel(0); |
||
40 | } |
||
41 | |||
42 | private void treeList1_DoubleClick(object sender, EventArgs e) |
||
43 | { |
||
44 | TreeList tree = sender as TreeList; |
||
45 | TreeListHitInfo hit = tree.CalcHitInfo(tree.PointToClient(Control.MousePosition)); |
||
46 | if (hit.Node != null) |
||
47 | { |
||
48 | TreeListNode node = hit.Node; |
||
49 | if (node.GetValue("Name").ToString().Contains(".sym")) |
||
50 | { |
||
51 | FullPath = node.GetValue("FullPath").ToString(); |
||
52 | DialogResult = DialogResult.OK; |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 | } |
||
57 | } |