コード例 #1
0
        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));
        }
コード例 #2
0
 internal static bool IsBehavioral(this PropertyRuleCategory category) =>
 category == PropertyRuleCategory.Behavior || category == PropertyRuleCategory.OnDemandData;
コード例 #3
0
 internal static bool IsValid(this PropertyRuleCategory category) =>
 PropertyRuleCategory.Data <= category && category <= PropertyRuleCategory.Unknown;