public static bool ToBool(this object foo) { if (foo.IsNull()) return false; else { var tmp = new[] { "on" }.Contains(foo) ? true : foo; return Convert.ToBoolean(tmp); } }