init
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user