개정판 db0d3db3
플러그인 실행시점 변경.
Change-Id: I947238b7503125168178c893fe47732c93fb0ef8
ConvertService/ServiceBase/Markus.Service.ConvertProcess/Program.cs | ||
---|---|---|
11 | 11 |
using System.Web.Script.Serialization; |
12 | 12 |
using System.Windows.Forms; |
13 | 13 |
using static Markus.Service.Extensions.Encrypt; |
14 |
using ConvertPlugin = Markus.Service.Convert.Plugin; |
|
15 | 14 |
|
16 | 15 |
namespace Markus.Service.ConvertProcess |
17 | 16 |
{ |
... | ... | |
48 | 47 |
} |
49 | 48 |
else |
50 | 49 |
{ |
51 |
var pluginPath = System.IO.Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Plugin"); |
|
52 |
var plugins = GenericPluginLoader<ConvertPlugin.IPlugin>.LoadPlugins(pluginPath); |
|
53 |
var config = ConfigHelper.AppConfig("Plugin.ini"); |
|
54 |
|
|
55 |
if(plugins != null) |
|
56 |
{ |
|
57 |
foreach (var item in plugins) |
|
58 |
{ |
|
59 |
Dictionary<string, object> parameters = new Dictionary<string, object>(); |
|
60 |
|
|
61 |
var sections = config.Sections.Where(x=>x.SectionName == item.Name); |
|
62 |
|
|
63 |
if (sections.Count() > 0) |
|
64 |
{ |
|
65 |
foreach (var param in sections.First().Keys) |
|
66 |
{ |
|
67 |
parameters.Add(param.Name, param.Content); |
|
68 |
} |
|
69 |
} |
|
70 |
|
|
71 |
var result = item.Do(convetContext.ConvertID, parameters); |
|
72 |
|
|
73 |
if(!result) |
|
74 |
{ |
|
75 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID} PlugIn Error : ",new Exception(item.Exception.ToString())); |
|
76 |
} |
|
77 |
} |
|
78 |
} |
|
79 |
else |
|
80 |
{ |
|
81 |
logger.Error($"Markus.Service.ConvertProcess Error Plugin Directory {pluginPath}"); |
|
82 |
} |
|
50 |
|
|
83 | 51 |
} |
84 | 52 |
} |
85 | 53 |
} |
내보내기 Unified diff