mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Created S# .sln and moved project to src folder
This commit is contained in:
34
ICD.Common/Utils/IcdEnvironment.Standard.cs
Normal file
34
ICD.Common/Utils/IcdEnvironment.Standard.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
#if STANDARD
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace ICD.Common.Utils
|
||||
{
|
||||
public static partial class IcdEnvironment
|
||||
{
|
||||
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 IEnumerable<string> NetworkAddresses
|
||||
{
|
||||
get
|
||||
{
|
||||
return NetworkInterface.GetAllNetworkInterfaces()
|
||||
.Where(ni => ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
|
||||
.SelectMany(ni => ni.GetIPProperties().UnicastAddresses
|
||||
.Where(ua => ua.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||
.Select(ua => ua.Address.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user