public static bool ConvertFromYesNo(this string text)
{
bool ret = false;
if (text == null)
throw new ArgumentException();
if (text.Equals("YES", StringComparison.CurrentCultureIgnoreCase))
ret = true;
else if (text.Equals("NO", StringComparison.CurrentCultureIgnoreCase))
ret = false;
else
throw new ArgumentException();
return ret;
}