inital
This commit is contained in:
17
IpRangeToConfigConverter/Models/SubnetDefinition.cs
Normal file
17
IpRangeToConfigConverter/Models/SubnetDefinition.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IpRangeToConfigConverter.Models
|
||||
{
|
||||
public class cSubnetDefinition
|
||||
{
|
||||
public string Subnet { get; set; }
|
||||
public string UpperSubnet { get; set; }
|
||||
public int? SubnetBits { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string ConnectionSpeed { get; set; }
|
||||
}
|
||||
}
|
||||
77
IpRangeToConfigConverter/Models/SubnetXmlValues.cs
Normal file
77
IpRangeToConfigConverter/Models/SubnetXmlValues.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace IpRangeToConfigConverter.Models
|
||||
{
|
||||
public class cSubnetXmlValues
|
||||
{
|
||||
[XmlArray("Computation-Subnet")]
|
||||
[XmlArrayItem("Computation-Subnet-Entry")]
|
||||
public List<cComputationSubnetEntry> SubnetEntries { get; set; } = new List<cComputationSubnetEntry>();
|
||||
|
||||
[XmlArray("Computation-Enumeration")]
|
||||
[XmlArrayItem("Computation-Enumeration-Entry")]
|
||||
public List<cComputationEnumerationEntry> SubnetEnumerations { get; set; } = new List<cComputationEnumerationEntry>();
|
||||
|
||||
public class cComputationSubnetEntry
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Subnet { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string UpperSubnet { get; set; }
|
||||
|
||||
|
||||
[XmlIgnore]
|
||||
public int? SubnetBits { get; set; }
|
||||
|
||||
[XmlAttribute("SubnetBits")]
|
||||
public string SubnetBitsAsText
|
||||
{
|
||||
get { return (SubnetBits.HasValue) ? SubnetBits.ToString() : null; }
|
||||
set { SubnetBits = !string.IsNullOrEmpty(value) ? int.Parse(value) : default(int?); }
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Value { get; set; }
|
||||
|
||||
public cComputationSubnetEntry()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public cComputationSubnetEntry(cSubnetDefinition subnetDefinition)
|
||||
{
|
||||
Subnet = subnetDefinition.Subnet;
|
||||
UpperSubnet = subnetDefinition.UpperSubnet;
|
||||
SubnetBits = subnetDefinition.SubnetBits;
|
||||
Value = subnetDefinition.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public class cComputationEnumerationEntry
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Value { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string EnumerationValue { get; set; }
|
||||
|
||||
public cComputationEnumerationEntry()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public cComputationEnumerationEntry(cSubnetDefinition subnetDefinition)
|
||||
{
|
||||
Value = subnetDefinition.Value;
|
||||
EnumerationValue = subnetDefinition.ConnectionSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user