public static string GetTimeReferenceHost(IPiApiClient piApiClient) { if (piApiClient.BaseAddress.ToLower().Contains("localhost")) { return("localhost"); } var host = Dns.GetHostEntry(Dns.GetHostName()); var localIps = host.AddressList .Where(a => a.AddressFamily == AddressFamily.InterNetwork) .OrderBy(ip => ip.ToString().StartsWith("192.168.1") ? 0 : 1); if (localIps.Any()) { return(localIps.First().ToString()); } throw new Exception("Local IP Address Not Found!"); }
public DevicePlayback(int projectDeviceId, IPiApiClient client) { ProjectDeviceId = projectDeviceId; Client = client; }