public Task <bool> Fix(IServiceRecommendation recommendation) { switch (recommendation.Type) { case ServiceRecommendationType.Service: return(this.ChangeStatus(recommendation.ServiceName, recommendation.ExpectedToRun)); case ServiceRecommendationType.OneTime: return(this.KillProcesses(recommendation.ServiceName)); case ServiceRecommendationType.WindowsDefender: return(this.DefenderSettings()); default: throw new NotSupportedException(); } }
public ServiceRecommendationViewModel( RepackagingRecommendationViewModel parent, IServiceRecommendationAdvisor advisor, IServiceRecommendation model, IInteractionService interactionService) { this.parent = parent; this.advisor = advisor; this.model = model; this.interactionService = interactionService; this.DisplayName = model.DisplayName; this.ServiceName = model.ServiceName; this.IsRunning = model.Actual; this.ShouldRun = model.ExpectedToRun; this.Recommendation = model.ActionPrompt; this.Type = model.Type; }
public Task <bool> Revert(IServiceRecommendation recommendation) { return(this.ChangeStatus(recommendation.ServiceName, !recommendation.ExpectedToRun)); }