markus / ConvertService / ServiceBase / ErrorNoticeTest / Program.cs @ 8acc4862
이력 | 보기 | 이력해설 | 다운로드 (1.52 KB)
1 | 731c84b8 | taeseongkim | using Markus.Service.Convert.Plugin; |
---|---|---|---|
2 | using Markus.Service.Extensions; |
||
3 | using Markus.Service.Helper; |
||
4 | using System; |
||
5 | using System.Collections.Generic; |
||
6 | using System.Linq; |
||
7 | using System.Text; |
||
8 | using System.Threading.Tasks; |
||
9 | |||
10 | namespace ErrorNoticeTest |
||
11 | { |
||
12 | class Program |
||
13 | { |
||
14 | private const string CONFIG_FILE = "Plugin.ini"; |
||
15 | private const string PLUGIN_PATH = "Plugin"; |
||
16 | |||
17 | static void Main(string[] args) |
||
18 | { |
||
19 | var baseDir = new System.IO.DirectoryInfo(AppDomain.CurrentDomain.SetupInformation.ApplicationBase).Parent.FullName; |
||
20 | var pluginPath = System.IO.Path.Combine(baseDir, PLUGIN_PATH); |
||
21 | var plugins = GenericPluginLoader<IPlugin>.LoadPlugins(pluginPath); |
||
22 | var config = ConfigHelper.AppConfig(System.IO.Path.Combine(baseDir, CONFIG_FILE)); |
||
23 | |||
24 | Console.WriteLine("PlugIn Load............"); |
||
25 | Console.Write("테스트용 Convert Doc ID : "); |
||
26 | var convertID = Console.ReadLine(); |
||
27 | Dictionary<string, object> parameters = new Dictionary<string, object>(); |
||
28 | |||
29 | ErrorNotice.ErrorNotice errorNotice = new ErrorNotice.ErrorNotice(); |
||
30 | |||
31 | var sections = config.Sections.Where(x => x.SectionName == "ErrorNotice"); |
||
32 | |||
33 | foreach (var param in sections.First().Keys) |
||
34 | { |
||
35 | parameters.Add(param.Name, param.Content); |
||
36 | Console.WriteLine($"{param.Name}: {param.Content}"); |
||
37 | } |
||
38 | |||
39 | ((Markus.Service.Convert.Plugin.IPlugin)errorNotice).Do(convertID, parameters); |
||
40 | } |
||
41 | } |
||
42 | } |