public PluginResult Scan(dynamic scanObject, PluginType type) { bool canFight = _config.ComponentsState.FightWithThreats; switch (type) { case PluginType.File: { List <IBeSafeFilePlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeFilePlugin>(_config.PluginsPath).ToList(); if (plugins.Any()) { return(SecureVolumePluginRegulator.Instance().Scan(plugins, scanObject, canFight)); } } break; case PluginType.Registry: { List <IBeSafeRegistryPlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeRegistryPlugin>(_config.PluginsPath).ToList(); if (plugins.Any()) { return(RegistryPluginRegulator.Instance().Scan(plugins, scanObject, canFight)); } } break; case PluginType.Process: { List <IBeSafeProcessPlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeProcessPlugin>(_config.PluginsPath).ToList(); if (plugins.Any()) { return(ProcessPluginRegulator.Instance().Scan(plugins, scanObject, canFight)); } } break; case PluginType.Module: { List <IBeSafeModulePlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeModulePlugin>(_config.PluginsPath).ToList(); if (plugins.Any()) { return(ModulePluginRegulator.Instance().Scan(plugins, scanObject, canFight)); } } break; default: return(null); } return(null); }
public static ProcessPluginRegulator Instance() => (SingletonInstance ?? (SingletonInstance = new ProcessPluginRegulator()));