markus / FinalService / KCOM_FinalService / FinalPDFClient / MainWindow.xaml.cs @ eaafc1eb
이력 | 보기 | 이력해설 | 다운로드 (1.94 KB)
1 |
using KCOMDataModel.DataModel; |
---|---|
2 |
using MarkupToPDF; |
3 |
using System; |
4 |
using System.Collections.Generic; |
5 |
using System.Linq; |
6 |
using System.Text; |
7 |
using System.Threading.Tasks; |
8 |
using System.Windows; |
9 |
using System.Windows.Controls; |
10 |
using System.Windows.Data; |
11 |
using System.Windows.Documents; |
12 |
using System.Windows.Input; |
13 |
using System.Windows.Media; |
14 |
using System.Windows.Media.Imaging; |
15 |
using System.Windows.Navigation; |
16 |
using System.Windows.Shapes; |
17 |
|
18 |
namespace FinalPDFClient |
19 |
{ |
20 |
/// <summary> |
21 |
/// MainWindow.xaml에 대한 상호 작용 논리 |
22 |
/// </summary> |
23 |
public partial class MainWindow : Window |
24 |
{ |
25 |
public MainWindow() |
26 |
{ |
27 |
InitializeComponent(); |
28 |
} |
29 |
|
30 |
public void MergedPDF() |
31 |
{ |
32 |
MarkupToPDF.MarkupToPDF markupToPDF = new MarkupToPDF.MarkupToPDF(); |
33 |
|
34 |
EventHandler<MakeFinalErrorArgs> errorEventHandler = null; |
35 |
EventHandler<EndFinalEventArgs> endFinalEventHandler = null; |
36 |
|
37 |
errorEventHandler = (snd, evt) => |
38 |
{ |
39 |
System.Diagnostics.Debug.WriteLine(evt.Message); |
40 |
|
41 |
markupToPDF.FinalMakeError -= errorEventHandler; |
42 |
markupToPDF.EndFinal -= endFinalEventHandler; |
43 |
}; |
44 |
|
45 |
endFinalEventHandler = (snd, evt) => |
46 |
{ |
47 |
System.Diagnostics.Debug.WriteLine(evt.Message); |
48 |
|
49 |
markupToPDF.FinalMakeError -= errorEventHandler; |
50 |
markupToPDF.EndFinal -= endFinalEventHandler; |
51 |
}; |
52 |
|
53 |
markupToPDF.FinalMakeError += errorEventHandler; |
54 |
markupToPDF.EndFinal += endFinalEventHandler; |
55 |
|
56 |
|
57 |
var addResult = markupToPDF.AddFinalPDF(txtProject.Text, txtDocId.Text, txtUserId.Text); |
58 |
|
59 |
if (addResult.Success) |
60 |
{ |
61 |
markupToPDF.MakeFinalPDF((object)addResult.FinalPDF); |
62 |
} |
63 |
} |
64 |
|
65 |
private void Button_Click(object sender, RoutedEventArgs e) |
66 |
{ |
67 |
MergedPDF(); |
68 |
} |
69 |
|
70 |
} |
71 |
} |