private void CheckValidIp(string ip)
{
Uri uri;
if (!Uri.TryCreate(string.Format("http://{0}/description.xml", ip), UriKind.Absolute, out uri))
{
//Invalid ip or hostname caused Uri creation to fail
throw new Exception(string.Format("The supplied ip to the HueClient is not a valid ip: {0}", ip));
}
}