public static bool TryParsePropertyCategory(string category, out PropertyRuleCategory categoryEnum) { Contracts.CheckNonEmpty(category, "category"); // Enum.TryParse uses a bunch of reflection and boxing. If this becomes an issue, we can // use plain-old switch statement. return(Enum.TryParse(category, ignoreCase: true, result: out categoryEnum)); }
internal static bool IsBehavioral(this PropertyRuleCategory category) => category == PropertyRuleCategory.Behavior || category == PropertyRuleCategory.OnDemandData;
internal static bool IsValid(this PropertyRuleCategory category) => PropertyRuleCategory.Data <= category && category <= PropertyRuleCategory.Unknown;