markus / ConvertService / ServiceBase / PemssDocumentInfoTest / Program.cs @ e6281033
이력 | 보기 | 이력해설 | 다운로드 (1.55 KB)
1 |
using Markus.Service.Helper; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
|
8 |
namespace PemssDocumentInfoTest |
9 |
{ |
10 |
class Program |
11 |
{ |
12 |
static void Main(string[] args) |
13 |
{ |
14 |
PemssDocumentInfo.DocumentInfoProcess documentInfoProcess = new PemssDocumentInfo.DocumentInfoProcess(); |
15 |
|
16 |
Console.Write("ConvertID : "); |
17 |
var cId = Console.ReadLine(); |
18 |
|
19 |
var config = ConfigHelper.AppConfig("Plugin.ini"); |
20 |
|
21 |
Dictionary<string, object> parameters = new Dictionary<string, object>(); |
22 |
|
23 |
var sections = config.Sections.Where(x => x.SectionName == documentInfoProcess.Name); |
24 |
|
25 |
if (sections.Count() > 0) |
26 |
{ |
27 |
foreach (var param in sections.First().Keys) |
28 |
{ |
29 |
parameters.Add(param.Name, param.Content); |
30 |
|
31 |
Console.WriteLine($"Key :{param.Name} value : {param.Content}"); |
32 |
} |
33 |
} |
34 |
try |
35 |
{ |
36 |
var result = (documentInfoProcess as Markus.Service.Convert.Plugin.IPlugin).Do(cId, parameters); |
37 |
|
38 |
if (result) |
39 |
{ |
40 |
Console.WriteLine("성공"); |
41 |
|
42 |
} |
43 |
else |
44 |
{ |
45 |
Console.WriteLine(documentInfoProcess.Exception); |
46 |
} |
47 |
} |
48 |
catch (Exception ex) |
49 |
{ |
50 |
Console.WriteLine(ex.ToString()); |
51 |
} |
52 |
|
53 |
Console.ReadLine(); |
54 |
|
55 |
|
56 |
} |
57 |
} |
58 |
} |