progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using System.Configuration;
|
||||
using AspClassic.Scripting.Utils;
|
||||
|
||||
namespace AspClassic.Scripting.Hosting.Configuration;
|
||||
|
||||
public class LanguageElement : ConfigurationElement
|
||||
{
|
||||
private const string _Names = "names";
|
||||
|
||||
private const string _Extensions = "extensions";
|
||||
|
||||
private const string _Type = "type";
|
||||
|
||||
private const string _DisplayName = "displayName";
|
||||
|
||||
private static ConfigurationPropertyCollection _Properties = new ConfigurationPropertyCollection
|
||||
{
|
||||
new ConfigurationProperty("names", typeof(string), null),
|
||||
new ConfigurationProperty("extensions", typeof(string), null),
|
||||
new ConfigurationProperty("type", typeof(string), null, ConfigurationPropertyOptions.IsRequired),
|
||||
new ConfigurationProperty("displayName", typeof(string), null)
|
||||
};
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties => _Properties;
|
||||
|
||||
public string Names
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base["names"];
|
||||
}
|
||||
set
|
||||
{
|
||||
base["names"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Extensions
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base["extensions"];
|
||||
}
|
||||
set
|
||||
{
|
||||
base["extensions"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base["type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
base["type"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base["displayName"];
|
||||
}
|
||||
set
|
||||
{
|
||||
base["displayName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string[] GetNamesArray()
|
||||
{
|
||||
return Split(Names);
|
||||
}
|
||||
|
||||
public string[] GetExtensionsArray()
|
||||
{
|
||||
return Split(Extensions);
|
||||
}
|
||||
|
||||
private static string[] Split(string str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
return ArrayUtils.EmptyStrings;
|
||||
}
|
||||
return str.Split(new char[2] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue