Ejemplo n.º 1
0
 public void Observe(IFeatureConfiguration configuration, FeatureConfigurationStatus status)
 {
     lock (@lock)
     {
         configurations.Add(configuration, status);
     }
 }
Ejemplo n.º 2
0
        private void Enforce(IFeatureConfiguration configuration, FeatureConfigurationStatus status)
        {
            var currentStatus = configuration.GetStatus();

            if (currentStatus != status)
            {
                logger.Warn($"{configuration} is {currentStatus.ToString().ToLower()} instead of {status.ToString().ToLower()}!");

                if (status == FeatureConfigurationStatus.Disabled)
                {
                    configuration.DisableFeature();
                }
                else if (status == FeatureConfigurationStatus.Enabled)
                {
                    configuration.EnableFeature();
                }
            }
        }