public async Task UpdateChocolateyFeature(ChocolateyFeature feature) { try { await _chocolateyService.SetFeature(feature); } catch (UnauthorizedAccessException) { await _progressService.ShowMessageAsync( Resources.General_UnauthorisedException_Title, Resources.General_UnauthorisedException_Description); } }
public async Task SetFeature(ChocolateyFeature feature) { using (await Lock.WriteLockAsync()) { _choco.Set( config => { config.CommandName = "feature"; config.FeatureCommand.Command = feature.Enabled ? chocolatey.infrastructure.app.domain.FeatureCommandType.enable : chocolatey.infrastructure.app.domain.FeatureCommandType.disable; config.FeatureCommand.Name = feature.Name; }); await _choco.RunAsync(); } }
public async Task SetFeature(ChocolateyFeature feature) { using (await Lock.WriteLockAsync()) { var choco = Lets.GetChocolatey().SetCustomLogging(new SerilogLogger(Logger, _progressService)); choco.Set( config => { config.CommandName = "feature"; config.FeatureCommand.Command = feature.Enabled ? FeatureCommandType.enable : FeatureCommandType.disable; config.FeatureCommand.Name = feature.Name; }); await choco.RunAsync(); } }
public void ChocolateyFeatureToggled(ChocolateyFeature feature) { _changedChocolateyFeature.OnNext(feature); }
private bool FilterChocolateyFeatures(ChocolateyFeature chocolateyFeature) { return(ChocolateyFeatureSearchQuery == null || chocolateyFeature.Name.IndexOf(ChocolateyFeatureSearchQuery, StringComparison.OrdinalIgnoreCase) != -1); }