private bool GetRequiredRuleData() { var truthy = new string[] { "TRUE", "YES", "1" }; try { if (RuleData.GetType() == typeof(bool)) { return((bool)RuleData); } bool convertedRuleData = truthy.Contains(RuleData.ToString().ToUpperInvariant()) ? true : false; return(convertedRuleData); } catch (System.Exception) { return(false); } }