Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static ModulePluginRegulator Instance() => (SingletonInstance ?? (SingletonInstance = new ModulePluginRegulator()));