Scope: implemented IComparable. fixed minor bugs.

This commit is contained in:
Shreyas Zare
2019-06-15 18:07:19 +05:30
parent 834b35bdc7
commit 981eddba10

View File

@@ -33,7 +33,7 @@ using TechnitiumLibrary.Net.Dns;
namespace DnsServerCore.Dhcp
{
public class Scope
public class Scope : IComparable<Scope>
{
#region variables
@@ -762,15 +762,20 @@ namespace DnsServerCore.Dhcp
}
}
if (_reservedLeases == null)
{
bW.Write(0);
}
else
{
bW.Write(_reservedLeases.Length);
foreach (Lease reservedLease in _reservedLeases)
reservedLease.WriteTo(bW);
bW.Write(_allowOnlyReservedLeases);
}
bW.Write(_allowOnlyReservedLeases);
{
bW.Write(_leases.Count);
@@ -818,6 +823,11 @@ namespace DnsServerCore.Dhcp
return _name;
}
public int CompareTo(Scope other)
{
return _name.CompareTo(other._name);
}
#endregion
#region properties
@@ -862,7 +872,9 @@ namespace DnsServerCore.Dhcp
get { return _domainName; }
set
{
DnsClient.IsDomainNameValid(value, true);
if (value != null)
DnsClient.IsDomainNameValid(value, true);
_domainName = value;
}
}