프로젝트

일반

사용자정보

통계
| 개정판:

hytos / DTI_PID / SPPIDConverter / MainWrapper.cs @ 1f0ae149

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

1 96a2080c gaqhf
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Drawing;
5
using System.Data;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9 cfda1fed gaqhf
using System.Threading;
10 96a2080c gaqhf
using System.Windows.Forms;
11 b8e2644e gaqhf
using Converter.SPPID.Model;
12
namespace Converter.SPPID
13 96a2080c gaqhf
{
14
    public partial class MainWrapper : UserControl
15
    {
16
        public MainWrapper()
17
        {
18
            InitializeComponent();
19
        }
20
21 cfda1fed gaqhf
        Thread thread;
22
23 96a2080c gaqhf
        public void ShowDialog()
24
        {
25
            ConverterForm form = new ConverterForm();
26
            if (form.ShowDialog() == DialogResult.OK)
27
            {
28 4bb0a307 gaqhf
                List<SPPID_Document> documents = form.Documents;
29 96a2080c gaqhf
                //dynamic application = Interaction.GetObject("", "PIDAutomation.Application");
30
                //dynamic newDrawing = application.Drawings.Add(sUnit, sTemplate, sDrawingNumber, sDrawingName);
31 4bb0a307 gaqhf
32 cfda1fed gaqhf
                thread = new Thread(func =>
33
                {
34
                    CloseOPCForm.Run();
35
                    try
36
                    {
37
                        foreach (SPPID_Document document in documents)
38
                        {
39
                            AutoModeling autoModeling = new AutoModeling(document);
40
                            autoModeling.Run();
41
                        }
42
                    }
43
                    catch (Exception ex)
44
                    {
45
                        MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
46
                    }
47
                    CloseOPCForm.Stop();
48
49
                });
50
                thread.Start();
51 96a2080c gaqhf
            }
52
        }
53
    }
54
}
클립보드 이미지 추가 (최대 크기: 500 MB)