Files
DP44/Common/DTS.Common.Core/.svn/pristine/2d/2d6a720297551e4625e1b5c50445da0ebb1107a1.svn-base
2026-04-17 14:55:32 -04:00

47 lines
1.5 KiB
Plaintext

using System.Configuration;
namespace DTS.Common.Core.PluginLib
{
/// <summary>
/// Support class that parses data from DTS.Common.Core.PluginLib.Config configuration section
/// </summary>
public class PluginConfigSectionHandler : ConfigurationSection
{
[ConfigurationProperty("PluginFolders")]
public FilterHashKeyCollection HashKeys => (FilterHashKeyCollection)base["PluginFolders"];
}
[ConfigurationCollection(typeof(FilterHashElement))]
public class FilterHashKeyCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return new FilterHashElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((FilterHashElement)element).Key;
}
public FilterHashElement this[int idx] => (FilterHashElement)BaseGet(idx);
}
public class FilterHashElement : ConfigurationElement
{
[ConfigurationProperty("key", DefaultValue = "", IsKey = true, IsRequired = true)]
public string Key
{
get => (string)base["key"];
set => base["key"] = value;
}
[ConfigurationProperty("value", DefaultValue = "", IsKey = false, IsRequired = false)]
public string Value
{
get => (string)base["value"];
set => base["value"] = value;
}
}
}