mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 15:47:09 -07:00
pretty...
This commit is contained in:
parent
beaf0cf939
commit
afafc6b032
285 changed files with 32688 additions and 784 deletions
121
CassiniDev/Configuration/CassiniDevConfigurationSection.cs
Normal file
121
CassiniDev/Configuration/CassiniDevConfigurationSection.cs
Normal file
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace CassiniDev.Configuration
|
||||
{
|
||||
public class CassiniDevConfigurationSection : ConfigurationSection
|
||||
{
|
||||
[ConfigurationProperty("profiles")]
|
||||
public CassiniDevProfileElementCollection Profiles
|
||||
{
|
||||
get
|
||||
{
|
||||
return (CassiniDevProfileElementCollection)this["profiles"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(CassiniDevProfileElement), AddItemName = "profile", CollectionType = ConfigurationElementCollectionType.BasicMap)]
|
||||
public class CassiniDevProfileElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new CassiniDevProfileElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((CassiniDevProfileElement)element).Port;
|
||||
}
|
||||
}
|
||||
public class CassiniDevProfileElement : ConfigurationElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Port is used as profile selector
|
||||
/// </summary>
|
||||
[ConfigurationProperty("port", DefaultValue = "*", IsKey = true, IsRequired = true)]
|
||||
public string Port
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this["port"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["port"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("path")]
|
||||
public string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this["path"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["path"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[ConfigurationProperty("hostName")]
|
||||
public string HostName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this["hostName"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["hostName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("ip")]
|
||||
public string IpAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this["ip"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["ip"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("ipMode", DefaultValue = CassiniDev.IPMode.Loopback)]
|
||||
public IPMode IpMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IPMode)this["ipMode"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["ipMode"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("v6", DefaultValue = false)]
|
||||
public bool IpV6
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)this["v6"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["v6"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue