개정판 2cae7d1f
dev issue #826 : add DialogBar Wrapper
DTI_PID/SPPIDConverter_AutoModeling/MainControl.cs | ||
---|---|---|
7 | 7 |
using System.Text; |
8 | 8 |
using System.Threading.Tasks; |
9 | 9 |
using System.Windows.Forms; |
10 |
using Microsoft.Win32; |
|
11 |
using Telerik.WinControls.UI; |
|
12 |
using System.IO; |
|
13 |
using System.Threading; |
|
14 |
using SPPID.Modeling; |
|
15 |
using SPPID.Model; |
|
16 |
using SPPID.Utill; |
|
10 | 17 |
|
11 | 18 |
namespace SPPIDConverter_AutoModeling |
12 | 19 |
{ |
13 | 20 |
public partial class MainControl : UserControl |
14 | 21 |
{ |
22 |
private Dictionary<string, string> symbolMapping = new Dictionary<string, string>(); |
|
23 |
private Dictionary<string, string> attributeMapping = new Dictionary<string, string>(); |
|
24 |
Thread autoModelingThread; |
|
25 |
|
|
15 | 26 |
public MainControl() |
16 | 27 |
{ |
17 | 28 |
InitializeComponent(); |
29 |
SetPath(); |
|
30 |
} |
|
31 |
|
|
32 |
private void btnLoadFiles_Click(object sender, EventArgs e) |
|
33 |
{ |
|
34 |
OpenFileDialog dia = new OpenFileDialog(); |
|
35 |
dia.Multiselect = true; |
|
36 |
dia.Filter = "Xml Files(*.xml)|*.xml"; |
|
37 |
if (dia.ShowDialog() == DialogResult.OK) |
|
38 |
{ |
|
39 |
SPPIDUtill.LoadMapping(symbolMapping, attributeMapping); |
|
40 |
|
|
41 |
foreach (string fileName in dia.FileNames) |
|
42 |
{ |
|
43 |
GridViewDataRowInfo row = new GridViewDataRowInfo(gridViewDrawingList.MasterView); |
|
44 |
Document document = Document.Load(fileName, symbolMapping, attributeMapping); |
|
45 |
|
|
46 |
row.Cells["colCheckBox"].Value = false; |
|
47 |
row.Cells["colDrawingName"].Value = fileName; |
|
48 |
row.Cells["colStatus"].Value = "Ready"; |
|
49 |
row.Cells["colDrawingFullName"].Value = fileName; |
|
50 |
gridViewDrawingList.Rows.Add(row); |
|
51 |
} |
|
52 |
} |
|
53 |
} |
|
54 |
|
|
55 |
private void SetPath() |
|
56 |
{ |
|
57 |
try |
|
58 |
{ |
|
59 |
RegistryKey key = Registry.LocalMachine; |
|
60 |
RegistryKey software = key.OpenSubKey("SOFTWARE"); |
|
61 |
RegistryKey DOFTECH = software.OpenSubKey("DOFTECH"); |
|
62 |
if (DOFTECH != null) |
|
63 |
{ |
|
64 |
RegistryKey ID2 = DOFTECH.OpenSubKey("ID2"); |
|
65 |
if (ID2 != null) |
|
66 |
{ |
|
67 |
SPPIDUtill.defaultPath = ID2.GetValue("Path").ToString(); |
|
68 |
|
|
69 |
Log.logPath = SPPIDUtill.defaultPath + @"Converter\SPPID Converter.log"; |
|
70 |
SPPIDUtill.mappingFilePath = SPPIDUtill.defaultPath + @"Converter\mapping.xml"; |
|
71 |
string dllPath = SPPIDUtill.defaultPath + @"Converter\SPPIDConverter.dll"; |
|
72 |
} |
|
73 |
} |
|
74 |
} |
|
75 |
catch (Exception ex) |
|
76 |
{ |
|
77 |
|
|
78 |
} |
|
18 | 79 |
} |
19 | 80 |
} |
20 | 81 |
} |
내보내기 Unified diff