public override void ApplyChanges()
        {
            if (!changed)
            {
                return;
            }

            for (int row = 0; row < featuresListStore.RowCount; ++row)
            {
                bool          enabled = featuresListStore.GetValue(row, featureEnabledDataField);
                FeatureSwitch feature = featuresListStore.GetValue(row, featureDataField);
                feature.Enabled = enabled;
            }

            FeatureSwitchConfigurations.OnFeaturesChanged();
        }
        void AddFeatures()
        {
            foreach (FeatureSwitch feature in FeatureSwitchConfigurations.GetFeatures())
            {
                int row = featuresListStore.AddRow();

                featuresListStore.SetValues(
                    row,
                    featureNameDataField,
                    feature.Name,
                    featureEnabledDataField,
                    feature.Enabled,
                    featureDataField,
                    feature);
            }
        }
        public bool?IsFeatureEnabled(string featureName)
        {
            if (bypass)
            {
                return(null);
            }

            FeatureSwitch feature = FeatureSwitchConfigurations.GetFeature(featureName);

            if (feature == null)
            {
                bool?enabled = IsFeatureEnabledIgnoringConfiguration(featureName);
                FeatureSwitchConfigurations.AddFeature(featureName, enabled);
            }

            return(null);
        }
Ejemplo n.º 4
0
 protected override void Run()
 {
     FeatureSwitchConfigurations.Initialize();
 }