예제 #1
0
        private static bool ValidateCasing(object value)
        {
            Debug.Assert(value is CharacterCasing);

            try
            {
                ArgumentHelper.AssertEnumMember((CharacterCasing)value, "value");
            }
            catch (ArgumentException)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        private static bool ValidateDateTimeConversionMode(object value)
        {
            Debug.Assert(value is DateTimeConversionMode);

            try
            {
                ArgumentHelper.AssertEnumMember((DateTimeConversionMode)value, "value");
            }
            catch (ArgumentException)
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
 //[CLSCompliant(false)]
 public static void AssertEnumMember <TEnum>(this TEnum enumValue, string argName, params TEnum[] validValues) where TEnum : struct, IConvertible
 {
     ArgumentHelper.AssertEnumMember <TEnum>(enumValue, argName, validValues);
 }