Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var availableFeatures = _extensionManager.AvailableFeatures().Select(i => i.Id).ToArray();
            var currentFeatures   = _shellDescriptor.Features.Select(i => i.Name).ToArray();
            var requiredFeatures  = _featureManager.GetRequiredFeatures();
            var model             = availableFeatures.Select(i => new FeatureViewModel
            {
                Name       = i,
                Enable     = currentFeatures.Contains(i),
                IsRequired = requiredFeatures.Contains(i)
            }).OrderBy(i => i.IsRequired).ToArray();

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult IndexPost()
        {
            var cbk = Request["cbk"] ?? string.Empty;

            var newFeatures = _featureManager.GetRequiredFeatures().Concat(cbk.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

            _shellDescriptorManager.UpdateShellDescriptor(_shellDescriptor.SerialNumber + 1, newFeatures.Select(i => new ShellFeature {
                Name = i
            }));

            return(RedirectToAction("Index"));
        }