public PluginRegistry()
{
var config = ConfigurationManager.GetSection("CollectdWinConfig") as CollectdWinConfig;
if (config == null)
{
LogEventInfo logEvent = new LogEventInfo(LogLevel.Error, Logger.Name, "Cannot get configuration section");
logEvent.Properties.Add("EventID", ErrorCodes.ERROR_CONFIGURATION_EXCEPTION);
Logger.Log(logEvent);
return;
}
foreach (PluginConfig pluginConfig in
config.PluginRegistry.Cast<PluginConfig>()
.Where(pluginConfig => pluginConfig.Enable))
{
_registry[pluginConfig.Name] = pluginConfig.Class;
}
}