mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Adding missing methods to Net Standard
This commit is contained in:
parent
17e7f4d3c9
commit
3fd344a308
2 changed files with 80 additions and 5 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
@ -13,11 +14,6 @@ namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
public static string NewLine { get { return Environment.NewLine; } }
|
public static string NewLine { get { return Environment.NewLine; } }
|
||||||
|
|
||||||
public static DateTime GetLocalTime()
|
|
||||||
{
|
|
||||||
return DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static eRuntimeEnvironment RuntimeEnvironment { get { return eRuntimeEnvironment.Standard; } }
|
public static eRuntimeEnvironment RuntimeEnvironment { get { return eRuntimeEnvironment.Standard; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// <summary>
|
||||||
/// Converts 12 digit address to XX:XX:XX... format
|
/// Converts 12 digit address to XX:XX:XX... format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
/// <summary>
|
||||||
/// Gets the ram usage in the range 0 - 1.
|
/// Gets the ram usage in the range 0 - 1.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -109,6 +135,29 @@ namespace ICD.Common.Utils
|
||||||
throw new NotSupportedException();
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue