Пример #1
0
 public void AddSpecification(IToggleSpecification specification)
 {
     if (specification == null)
     {
         throw new ArgumentNullException(nameof(specification));
     }
     _specificationData.Add(specification, new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase));
 }
Пример #2
0
		public FileProvider(IFileReader fileReader)
		{
			_fileReader = fileReader;
			var defaultSpecifications = new IToggleSpecification[]
			{
				new TrueSpecification(), new FalseSpecification()
			};
			_specifications = defaultSpecifications.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase);
		}
Пример #3
0
		public IToggleChecker Create()
		{
			if (_userProvider == null)
				_userProvider = new NullUserProvider();
			if(_defaultToggleSpecification==null)
				_defaultToggleSpecification = new FalseSpecification();

			var featureProvider = _featureProviderFactory.Create();
			return new ToggleChecker(featureProvider, _defaultToggleSpecification, _userProvider);
		}
Пример #4
0
        public IToggleChecker Create()
        {
            if (_userProvider == null)
            {
                _userProvider = new NullUserProvider();
            }
            if (_defaultToggleSpecification == null)
            {
                _defaultToggleSpecification = new BoolSpecification(false);
            }

            var featureProviders = _featureProviderFactories.Select(factory => factory.Create()).ToArray();

            return(new ToggleChecker(featureProviders, _defaultToggleSpecification, _userProvider));
        }
Пример #5
0
        public IToggleChecker Create()
        {
            if (_userProvider == null)
            {
                _userProvider = new NullUserProvider();
            }
            if (_defaultToggleSpecification == null)
            {
                _defaultToggleSpecification = new FalseSpecification();
            }

            var featureProvider = _featureProviderFactory.Create();

            return(new ToggleChecker(featureProvider, _defaultToggleSpecification, _userProvider));
        }
Пример #6
0
 public Feature(IToggleSpecification specification)
 {
     _specificationData = new Dictionary <IToggleSpecification, IDictionary <string, string> >();
     AddSpecification(specification);
 }
Пример #7
0
 internal ToggleChecker(IEnumerable <IFeatureProvider> featureProviders, IToggleSpecification defaultToggleSpecification, IUserProvider userProvider)
 {
     _featureProviders           = featureProviders;
     _defaultToggleSpecification = defaultToggleSpecification;
     _userProvider = userProvider;
 }
 public void AddMapping(string specificationName, IToggleSpecification specification)
 {
     _mappings.Add(specificationName, specification);
 }
Пример #9
0
		public void AddSpecification(IToggleSpecification specification)
		{
			if(specification==null)
				throw new ArgumentNullException("specification");
			_specifications.Add(specification);
		}
Пример #10
0
		public Feature(string flagName, IToggleSpecification specification)
		{
			FlagName = flagName;
			_specifications = new List<IToggleSpecification>();
			AddSpecification(specification);
		}
Пример #11
0
 public ToggleConfiguration SetDefaultSpecification(IToggleSpecification toggleSpecification)
 {
     _defaultToggleSpecification = toggleSpecification;
     return(this);
 }
Пример #12
0
 public void AddParameter(IToggleSpecification specification, string parameterName, string parameterValue)
 {
     _specificationData[specification].Add(parameterName, parameterValue);
 }
Пример #13
0
		internal ToggleChecker(IFeatureProvider featureProvider, IToggleSpecification defaulToggleSpecification, IUserProvider userProvider)
		{
			_featureProvider = featureProvider;
			_defaulToggleSpecification = defaulToggleSpecification;
			_userProvider = userProvider;
		}
		public void AddMapping(string specificationName, IToggleSpecification specification)
		{
			_mappings.Add(specificationName, specification);
		}
Пример #15
0
		public void AddParameter(IToggleSpecification specification, string parameterName, string parameterValue)
		{
			_specificationData[specification].Add(parameterName, parameterValue);
		}
Пример #16
0
		public void AddSpecification(IToggleSpecification specification)
		{
			if(specification==null)
				throw new ArgumentNullException(nameof(specification));
			_specificationData.Add(specification, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase));
		}
Пример #17
0
		public Feature(IToggleSpecification specification)
		{
			_specificationData = new Dictionary<IToggleSpecification, IDictionary<string, string>>();
			AddSpecification(specification);
		}
Пример #18
0
 internal ToggleChecker(IFeatureProvider featureProvider, IToggleSpecification defaultToggleSpecification, IUserProvider userProvider)
 {
     _featureProvider            = featureProvider;
     _defaultToggleSpecification = defaultToggleSpecification;
     _userProvider = userProvider;
 }
Пример #19
0
		public ToggleConfiguration SetDefaultSpecification(IToggleSpecification toggleSpecification)
		{
			_defaultToggleSpecification = toggleSpecification;
			return this;
		}