Example #1
0
        public bool IsExperimentEnabled(ExperimentationConstants experimentation)
        {
            var isEnvVarEnabled = !string.IsNullOrEmpty(experimentation.FlightEnvironmentVariable) &&
                                  _environmentVariableReader.GetEnvironmentVariable(experimentation.FlightEnvironmentVariable) == "1";

            return(isEnvVarEnabled || _experimentationService.IsCachedFlightEnabled(experimentation.FlightFlag));
        }
Example #2
0
        public bool IsExperimentEnabled(ExperimentationConstants experiment)
        {
            var isExpForcedEnabled  = false;
            var isExpForcedDisabled = false;

            if (!string.IsNullOrEmpty(experiment.FlightEnvironmentVariable))
            {
                string envVarOverride = _environmentVariableReader.GetEnvironmentVariable(experiment.FlightEnvironmentVariable);

                isExpForcedDisabled = envVarOverride == "0";
                isExpForcedEnabled  = envVarOverride == "1";
            }

            return(!isExpForcedDisabled && (isExpForcedEnabled || _experimentationService.IsCachedFlightEnabled(experiment.FlightFlag)));
        }
 /// <summary>
 /// Handles requests for Flight.NameOfFlight
 /// </summary>
 /// <param name="key">Name of the flight</param>
 /// <returns>A True <see cref="T:Coding4Fun.VisualStudio.RemoteSettings.BoolScopeValue" /> if flight is enabled.</returns>
 public BoolScopeValue Provide(string key)
 {
     return(new BoolScopeValue(experimentationService.IsCachedFlightEnabled(key)));
 }