コード例 #1
0
        public IActionResult Disable(Guid id)
        {
            var module = _pluginManager.GetPlugin(id);

            _pluginManager.DisablePlugin(id);
            var moduleName = module.Name;

            var last = _partManager.ApplicationParts.First(p => p.Name == moduleName);

            _partManager.ApplicationParts.Remove(last);

            MyActionDescriptorChangeProvider.Instance.HasChanged = true;
            MyActionDescriptorChangeProvider.Instance.TokenSource.Cancel();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult DisablePlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version)
        {
            var plugin = _pluginManager.GetPlugin(pluginId, version);
            if (plugin == null)
            {
                return NotFound();
            }

            _pluginManager.DisablePlugin(plugin);
            return NoContent();
        }
コード例 #3
0
ファイル: PluginsController.cs プロジェクト: ym1100/CoolCat
 public IActionResult Disable(Guid id)
 {
     _pluginManager.DisablePlugin(id);
     return(RedirectToAction("Index"));
 }