프로젝트

일반

사용자정보

개정판 29aa5251

ID29aa5251874fdddc142123d3ac1df00fe1cdccea
상위 fe57f64a
하위 08fae8c9

백흠경이(가) 일년 이상 전에 추가함

Feature: PDF 보기 기능 추가

Change-Id: Id05e9545b71d7e2a911e302aceeecff612201667

차이점 보기:

ID2.Manager/ID2.Manager.wxs
429 429
            <Component Id="cmp0CBE120D505CFB3DC07D73B347154B9E" Directory="INSTALLFOLDER" Guid="E6F64B32-5F57-439E-AA94-A0034ED5D08F" Win64="yes">
430 430
                <File Id="filC25DF410D50E2DE059118F8481AAE991" KeyPath="yes" Source="$(var.SourceDir)\Telerik.WinControls.GridView.dll" />
431 431
            </Component>
432
			<Component Id="cmpF4C711EDC1704869AFB8988CC2FFA318" Directory="INSTALLFOLDER" Guid="2A0F9C6B-F4D5-42E5-A027-A08C5CF25F29" Win64="yes">
433
                <File Id="fil47BE10F8F0834C03BC8391065D61C439" KeyPath="yes" Source="$(var.SourceDir)\Telerik.WinControls.PdfViewer.dll" />
434
            </Component>
435
			<Component Id="cmp85D5DE13A7D348C797AC6A1617B0ADC4" Directory="INSTALLFOLDER" Guid="9BB45992-3E1F-44CE-8E95-31F921A20232" Win64="yes">
436
                <File Id="fil85FE521AA0D5424FAD5F2DB45F84B896" KeyPath="yes" Source="$(var.SourceDir)\Telerik.Windows.Documents.Core.dll" />
437
            </Component>
438
			<Component Id="cmp8FB16C8B91FF43A8A62B3CCAAC905250" Directory="INSTALLFOLDER" Guid="F1395CFF-68C7-43A8-8960-DC4AB0189D05" Win64="yes">
439
                <File Id="fil6BC1F666A93D492BB48B309648651535" KeyPath="yes" Source="$(var.SourceDir)\Telerik.Windows.Documents.Fixed.dll" />
440
            </Component>
432 441
            <Component Id="cmp453EB614D9A012AF87DE2D64A80F69D4" Directory="INSTALLFOLDER" Guid="7B0084FB-F203-405D-9042-050E76A5AB45" Win64="yes">
433 442
                <File Id="fil11C03868D44B2888C9B7F83BAD2D3054" KeyPath="yes" Source="$(var.SourceDir)\Telerik.WinControls.RadDiagram.dll" />
434 443
            </Component>
ID2.Manager/ID2.Manager/Controls/PDFViewer.cs
12 12
{
13 13
    public partial class PDFViewer : UserControl
14 14
    {
15
        private Telerik.WinControls.UI.RadPdfViewer radPdfViewerDWG;
16

  
15 17
        public PDFViewer()
16 18
        {
17 19
            InitializeComponent();
......
19 21

  
20 22
        private void InitializeComponent()
21 23
        {
24
            this.radPdfViewerDWG = new Telerik.WinControls.UI.RadPdfViewer();
25
            ((System.ComponentModel.ISupportInitialize)(this.radPdfViewerDWG)).BeginInit();
22 26
            this.SuspendLayout();
23 27
            // 
28
            // radPdfViewerDWG
29
            // 
30
            this.radPdfViewerDWG.AutoScroll = true;
31
            this.radPdfViewerDWG.Dock = System.Windows.Forms.DockStyle.Fill;
32
            this.radPdfViewerDWG.EnableThumbnails = false;
33
            this.radPdfViewerDWG.FitToWidth = true;
34
            this.radPdfViewerDWG.Location = new System.Drawing.Point(0, 0);
35
            this.radPdfViewerDWG.Name = "radPdfViewerDWG";
36
            this.radPdfViewerDWG.Size = new System.Drawing.Size(315, 290);
37
            this.radPdfViewerDWG.TabIndex = 0;
38
            this.radPdfViewerDWG.ThumbnailsScaleFactor = 0.15F;
39
            // 
24 40
            // PDFViewer
25 41
            // 
42
            this.Controls.Add(this.radPdfViewerDWG);
26 43
            this.Name = "PDFViewer";
27 44
            this.Size = new System.Drawing.Size(315, 290);
45
            ((System.ComponentModel.ISupportInitialize)(this.radPdfViewerDWG)).EndInit();
28 46
            this.ResumeLayout(false);
29 47

  
30 48
        }
49

  
50
        /// <summary>
51
        /// pdf 파일을 읽어 화면에 표시합니다.
52
        /// </summary>
53
        /// <param name="PDFFilePath"></param>
54
        public void ReadPDF(string PDFFilePath)
55
        {
56
            if (System.IO.File.Exists(PDFFilePath))
57
            {
58
                this.radPdfViewerDWG.LoadDocument(PDFFilePath);
59
            }
60
        }
31 61
    }
32 62
}
ID2.Manager/ID2.Manager/ID2.Manager.csproj
57 57
    <ApplicationIcon>ID2 Manager.ico</ApplicationIcon>
58 58
  </PropertyGroup>
59 59
  <ItemGroup>
60
    <Reference Include="PresentationCore" />
60 61
    <Reference Include="System" />
61 62
    <Reference Include="System.Core" />
62 63
    <Reference Include="System.Xml.Linq" />
......
68 69
    <Reference Include="System.Net.Http" />
69 70
    <Reference Include="System.Windows.Forms" />
70 71
    <Reference Include="System.Xml" />
72
    <Reference Include="Telerik.WinControls.PdfViewer, Version=2023.1.314.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e, processorArchitecture=MSIL" />
73
    <Reference Include="Telerik.Windows.Documents.Core, Version=2023.1.307.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7" />
74
    <Reference Include="Telerik.Windows.Documents.Fixed, Version=2023.1.307.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7" />
75
    <Reference Include="WindowsBase" />
71 76
  </ItemGroup>
72 77
  <ItemGroup>
73 78
    <Compile Include="Classes\BaseWorker.cs" />
ID2.Manager/ID2.Manager/Main.cs
43 43
        {
44 44
            InitializeComponent();
45 45

  
46
       
47 46
            //Telerik.WinControls.RadControlSpy.RadControlSpyForm radControlSpyForm = new Telerik.WinControls.RadControlSpy.RadControlSpyForm();
48 47
            //radControlSpyForm.Show();
49 48

  
......
63 62
            this.radButtonSearch.Click += RadButtonSearch_Click;
64 63
            this.radButtonID2.Click += RadButtonID2_Click;
65 64

  
65
            this.radGridViewDocuments.SelectionChanged += RadGridViewDocuments_SelectionChanged;
66 66
            this.radGridViewDocuments.ViewCellFormatting += RadGridViewDocuments_ViewCellFormatting;
67 67
            this.radGridViewDocuments.CellBeginEdit += RadGridViewDocuments_CellBeginEdit;
68 68
            this.radGridViewDocuments.CommandCellClick += RadGridViewDocuments_CommandCellClick;
......
87 87
            this.Initialize();
88 88
        }
89 89

  
90
        /// <summary>
91
        /// 선택된 행의 AutoCAD와 PDF 파일을 보여준다.
92
        /// </summary>
93
        /// <param name="sender"></param>
94
        /// <param name="e"></param>
95
        private void RadGridViewDocuments_SelectionChanged(object sender, EventArgs e)
96
        {
97
            void ShowAutoCADFile(string FilePath)
98
            {
99
                Controls.AutoCADViewer viewer = null;
100
                foreach (var control in this.radSplitContainerViewer.SplitPanels[0].Controls)
101
                {
102
                    if (control is Controls.AutoCADViewer _viewer)
103
                    {
104
                        viewer = _viewer;
105
                        break;
106
                    }
107
                }
108

  
109
                if (viewer == null)
110
                {
111
                    viewer = new Controls.AutoCADViewer() { Dock = DockStyle.Fill };
112
                    this.radSplitContainerViewer.SplitPanels[0].Controls.Add(viewer);
113
                }
114
                else
115
                {
116
                    viewer.Visible = true;
117
                }
118

  
119
                if (File.Exists(FilePath) && viewer != null) viewer.ReadDWG(FilePath);
120
            }
121

  
122
            void ShowPDFFile(string FilePath)
123
            {
124
                Controls.PDFViewer viewer = null;
125
                foreach (var control in this.radSplitContainerViewer.SplitPanels[1].Controls)
126
                {
127
                    if (control is Controls.PDFViewer _viewer)
128
                    {
129
                        viewer = _viewer;
130
                        break;
131
                    }
132
                }
133

  
134
                if (viewer == null)
135
                {
136
                    viewer = new Controls.PDFViewer() { Dock = DockStyle.Fill };
137
                    this.radSplitContainerViewer.SplitPanels[1].Controls.Add(viewer);
138
                }
139
                else
140
                {
141
                    viewer.Visible = true;
142
                }
143

  
144
                if (File.Exists(FilePath) && viewer != null) viewer.ReadPDF(FilePath);
145
            }
146

  
147
            Documents doc = this.radGridViewDocuments.SelectedRows.First().DataBoundItem as Documents;
148
            {
149
                string extension = ".dwg";
150
                string filePath = Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", "Native", $"{doc.DocumentNo}{extension}");
151
                ShowAutoCADFile(filePath);
152
            }
153

  
154
            {
155
                string extension = ".pdf";
156
                string filePath = Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", $"{doc.DocumentNo}{extension}");
157
                ShowPDFFile(filePath);
158
            }
159
        }
160

  
90 161
        #region Init, Load
91 162
        private void Initialize()
92 163
        {
......
606 677

  
607 678
                switch (e.Column.Name)
608 679
                {
609
                    case "AutoCADLink":
610
                        {
611
                            Controls.AutoCADViewer viewer = null;
612
                            foreach (var control in this.radSplitContainerViewer.SplitPanels[0].Controls)
613
                            {
614
                                if (control is Controls.AutoCADViewer _viewer)
615
                                {
616
                                    viewer = _viewer;
617
                                    break;
618
                                }
619
                            }
620

  
621
                            if (viewer == null)
622
                            {
623
                                viewer = new Controls.AutoCADViewer() { Dock = DockStyle.Fill };
624
                                this.radSplitContainerViewer.SplitPanels[0].Controls.Add(viewer);
625
                            }
626
                            else
627
                            {
628
                                viewer.Visible = true;
629
                            }
630

  
631
                            if (e.Row.DataBoundItem is Documents doc)
632
                            {
633
                                extension = "dwg";
634
                                string filePath = Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", "Native", $"{doc.DocumentNo}.{extension}");
635

  
636
                                if (File.Exists(filePath) && viewer != null) viewer.ReadDWG(filePath);
637
                            }
638
                        }
639
                        break;
640
                    case "PDFLink":
641
                        Controls.PDFViewer pdfviewer = null;
642
                        foreach (var control in this.radSplitContainerViewer.SplitPanels[1].Controls)
643
                        {
644
                            if (control is Controls.PDFViewer _viewer)
645
                            {
646
                                pdfviewer = _viewer;
647
                                break;
648
                            }
649
                        }
650

  
651
                        if (pdfviewer == null)
652
                        {
653
                            pdfviewer = new Controls.PDFViewer() { Dock = DockStyle.Fill };
654
                            this.radSplitContainerViewer.SplitPanels[1].Controls.Add(pdfviewer);
655
                        }
656
                        else
657
                        {
658
                            pdfviewer.Visible = true;
659
                        }
660

  
661
                        break;
662 680
                    case "MarkupLink":
663 681
                        {
664 682
                            if (e.Row.DataBoundItem is Documents doc)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)