public IList<ICollectdPlugin> CreatePlugins()
{
IList<ICollectdPlugin> plugins = new List<ICollectdPlugin>();
foreach (var entry in _registry)
{
Type classType = Type.GetType(entry.Value);
if (classType == null)
{
LogEventInfo logEvent = new LogEventInfo(LogLevel.Error, Logger.Name, String.Format("Cannot create plugin:{0}, class:{1}", entry.Key, entry.Value));
logEvent.Properties.Add("EventID", ErrorCodes.ERROR_CONFIGURATION_EXCEPTION);
Logger.Log(logEvent);
continue;
}
var plugin = (ICollectdPlugin) Activator.CreateInstance(classType);
plugins.Add(plugin);
}
return (plugins);
}