private static object Invert(object value) { var result = false; if (value is bool) { return !(bool)value; } return result; } }