fix: Adding missing methods to Net Standard

This commit is contained in:
Chris Cameron
2019-03-27 10:49:29 -04:00
parent 17e7f4d3c9
commit 3fd344a308
2 changed files with 80 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text.RegularExpressions;
@@ -13,11 +14,6 @@ namespace ICD.Common.Utils
{
public static string NewLine { get { return Environment.NewLine; } }
public static DateTime GetLocalTime()
{
return DateTime.Now;
}
public static eRuntimeEnvironment RuntimeEnvironment { get { return eRuntimeEnvironment.Standard; } }
/// <summary>
@@ -53,6 +49,36 @@ namespace ICD.Common.Utils
}
}
/// <summary>
/// Gets the dhcp status of the processor.
/// </summary>
[PublicAPI]
public static string DhcpStatus
{
get
{
bool enabled =
NetworkInterface.GetAllNetworkInterfaces()
.Where(ni => ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 ||
ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
.Select(ni => ni.GetIPProperties().GetIPv4Properties().IsDhcpEnabled)
.FirstOrDefault();
return enabled.ToString();
}
}
/// <summary>
/// Gets the hostname of the processor.
/// </summary>
[PublicAPI]
public static IEnumerable<string> Hostname { get { yield return Dns.GetHostName(); } }
public static DateTime GetLocalTime()
{
return DateTime.Now;
}
/// <summary>
/// Converts 12 digit address to XX:XX:XX... format
/// </summary>

View File

@@ -27,6 +27,32 @@ namespace ICD.Common.Utils
}
}
/// <summary>
/// Gets the date that the firmware was updated.
/// </summary>
[PublicAPI]
public static string ModelVersionDate
{
get
{
// TODO
return null;
}
}
/// <summary>
/// Gets the serial number of the processor
/// </summary>
[PublicAPI]
public static string ProcessorSerialNumber
{
get
{
// TODO
return null;
}
}
/// <summary>
/// Gets the ram usage in the range 0 - 1.
/// </summary>
@@ -109,6 +135,29 @@ namespace ICD.Common.Utils
throw new NotSupportedException();
}
/// <summary>
/// Gets the uptime for the system
/// </summary>
/// <returns></returns>
[PublicAPI]
public static string GetSystemUptime()
{
// TODO
return null;
}
/// <summary>
/// Gets the uptime
/// </summary>
/// <param name="progslot"></param>
/// <returns></returns>
[PublicAPI]
public static string GetProgramUptime(int progslot)
{
// TODO
return null;
}
#endregion
}
}