Exemplo n.º 1
0
 private static void SetTogglesFromNameAttribute(FeaturesConfigurationSection toggles)
 {
     toggles.Names.Split(',').Where(s => !string.IsNullOrEmpty(s)).ToList().ForEach(f =>
     {
         var switchName = f.Trim();
         RememberSwitchName(switchName);
         AppContext.SetSwitch(switchName, true);
     });
 }
Exemplo n.º 2
0
 private static void SetTogglesFromNameAttribute(FeaturesConfigurationSection toggles)
 {
     toggles.Names.Split(',').Where(s => !string.IsNullOrEmpty(s)).ToList().ForEach(f =>
     {
         var switchName = f.Trim();
         RememberSwitchName(switchName);
         AppContext.SetSwitch(switchName, true);
     });
 }
Exemplo n.º 3
0
        private static void SetTogglesFromFeatureElements(FeaturesConfigurationSection toggles)
        {
            foreach (FeatureElement feature in toggles.Features)
            {
                var switchName = feature.Name.Trim();
                if(string.IsNullOrEmpty(switchName)) throw new ConfigurationErrorsException("Feature elements must contain a name.");

                RememberSwitchName(switchName);
                AppContext.SetSwitch(switchName, feature.Activated);
            }
        }
Exemplo n.º 4
0
        private static void SetTogglesFromFeatureElements(FeaturesConfigurationSection toggles)
        {
            foreach (FeatureElement feature in toggles.Features)
            {
                var switchName = feature.Name.Trim();
                if (string.IsNullOrEmpty(switchName))
                {
                    throw new ConfigurationErrorsException("Feature elements must contain a name.");
                }

                RememberSwitchName(switchName);
                AppContext.SetSwitch(switchName, feature.Activated);
            }
        }