Exemplo n.º 1
0
        public static string GetBooleanValue(this BooleanType enumerationValue, bool value)
        {
            var attribute = enumerationValue.GetEnumValue <BooleanType, BooleanValueAttribute>();

            if (attribute == null)
            {
                throw new Exception("Boolean enumerations must be annotated with a BooleanValueAttribute");
            }

            return((value) ? attribute.TrueValue : attribute.FalseValue);
        }