Ejemplo n.º 1
0
        public static DescriptionOptions GetDescriptionOptions(Type type)
        {
            var doa = type.GetCustomAttribute <DescriptionOptionsAttribute>(true);

            if (doa != null)
            {
                return(type.IsGenericTypeDefinition ? doa.Options & DescriptionOptions.Members : doa.Options);
            }

            DescriptionOptions?def = DescriptionManager.OnDefaultDescriptionOptions(type);

            if (def != null)
            {
                return(type.IsGenericTypeDefinition ? def.Value & DescriptionOptions.Members : def.Value);
            }

            if (DescriptionManager.ExternalEnums.ContainsKey(type))
            {
                return(DescriptionOptions.Members);
            }

            return(DescriptionOptions.None);
        }