This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,34 @@
using System.Configuration;
namespace Kreta.Core.FeatureToggle.Configuration
{
public class FeatureConfigurationSection : ConfigurationSection
{
[ConfigurationProperty(nameof(SimpleFeatures))]
public SimpleFeatureConfigurationCollection SimpleFeatures => (SimpleFeatureConfigurationCollection)base[nameof(SimpleFeatures)];
[ConfigurationProperty(nameof(SendErtekelesNotification))]
public ExtendedSendMobileNotification SendErtekelesNotification => (ExtendedSendMobileNotification)base[nameof(SendErtekelesNotification)];
[ConfigurationProperty(nameof(SendHazifeladatNotification))]
public ExtendedSendMobileNotification SendHazifeladatNotification => (ExtendedSendMobileNotification)base[nameof(SendHazifeladatNotification)];
[ConfigurationProperty(nameof(SendRendszerUzenetNotification))]
public ExtendedSendMobileNotification SendRendszerUzenetNotification => (ExtendedSendMobileNotification)base[nameof(SendRendszerUzenetNotification)];
[ConfigurationProperty(nameof(SendBejelentettSzamonkeresNotification))]
public ExtendedSendMobileNotification SendBejelentettSzamonkeresNotification => (ExtendedSendMobileNotification)base[nameof(SendBejelentettSzamonkeresNotification)];
[ConfigurationProperty(nameof(SendFeljegyzesNotification))]
public ExtendedSendMobileNotification SendFeljegyzesNotification => (ExtendedSendMobileNotification)base[nameof(SendFeljegyzesNotification)];
[ConfigurationProperty(nameof(SendMulasztasNotification))]
public ExtendedSendMobileNotification SendMulasztasNotification => (ExtendedSendMobileNotification)base[nameof(SendMulasztasNotification)];
[ConfigurationProperty(nameof(SendOrarendValtozasNotification))]
public ExtendedSendMobileNotification SendOrarendValtozasNotification => (ExtendedSendMobileNotification)base[nameof(SendOrarendValtozasNotification)];
[ConfigurationProperty(nameof(SendNemNaplozottTanorakMail))]
public ExtendedSendMobileNotification SendNemNaplozottTanorakMail => (ExtendedSendMobileNotification)base[nameof(SendNemNaplozottTanorakMail)];
}
}

View file

@ -0,0 +1,40 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
namespace Kreta.Core.FeatureToggle.Configuration
{
public class SimpleFeatureConfiguration : ConfigurationElement
{
[ConfigurationProperty(nameof(Name), IsKey = true, IsRequired = true)]
public string Name => base[nameof(Name)].ToString();
[ConfigurationProperty(nameof(IsEnabled), IsKey = false, IsRequired = true)]
public bool IsEnabled => bool.Parse(base[nameof(IsEnabled)].ToString());
[ConfigurationProperty(nameof(InstituteIds), IsKey = false, IsRequired = false)]
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
public IEnumerable<string> InstituteIds
{
get
{
var instituteIds = ((CommaDelimitedStringCollection)base[nameof(InstituteIds)]);
return (instituteIds != null) ? instituteIds.OfType<string>() : new List<string>();
}
}
[ConfigurationProperty(nameof(Environments), IsKey = false, IsRequired = false)]
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
public IEnumerable<string> Environments
{
get
{
var environments = ((CommaDelimitedStringCollection)base[nameof(Environments)]);
return (environments != null) ? environments.OfType<string>() : new List<string>();
}
}
}
}

View file

@ -0,0 +1,31 @@
using System.Configuration;
namespace Kreta.Core.FeatureToggle.Configuration
{
[ConfigurationCollection(typeof(SimpleFeatureConfiguration))]
public class SimpleFeatureConfigurationCollection : ConfigurationElementCollection
{
protected override string ElementName => nameof(SimpleFeature);
protected override ConfigurationElement CreateNewElement() => new SimpleFeatureConfiguration();
protected override object GetElementKey(ConfigurationElement element) => ((SimpleFeatureConfiguration)element).Name;
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMapAlternate;
}
public class ExtendedSendMobileNotification : ConfigurationElement
{
[ConfigurationProperty(nameof(CustomCronExpression))]
public string CustomCronExpression => base[nameof(CustomCronExpression)].ToString();
[ConfigurationProperty(nameof(SendItervalInMinute))]
public string SendItervalInMinute => base[nameof(SendItervalInMinute)].ToString();
[ConfigurationProperty(nameof(RunningIntervalStartHour))]
public string RunningIntervalStartHour => base[nameof(RunningIntervalStartHour)].ToString();
[ConfigurationProperty(nameof(RunningIntervalEndHour))]
public string RunningIntervalEndHour => base[nameof(RunningIntervalEndHour)].ToString();
}
}