Ejemplo n.º 1
0
 public async Task UpdateChocolateyFeature(ChocolateyFeature feature)
 {
     try
     {
         await _chocolateyService.SetFeature(feature);
     }
     catch (UnauthorizedAccessException)
     {
         await _progressService.ShowMessageAsync(
             Resources.General_UnauthorisedException_Title,
             Resources.General_UnauthorisedException_Description);
     }
 }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
 public void ChocolateyFeatureToggled(ChocolateyFeature feature)
 {
     _changedChocolateyFeature.OnNext(feature);
 }
Ejemplo n.º 5
0
 private bool FilterChocolateyFeatures(ChocolateyFeature chocolateyFeature)
 {
     return(ChocolateyFeatureSearchQuery == null ||
            chocolateyFeature.Name.IndexOf(ChocolateyFeatureSearchQuery, StringComparison.OrdinalIgnoreCase) != -1);
 }