Пример #1
0
        public static FormBuilderControlMetadata GetMetadataAttribute(this FormBuilderControlType type)
        {
            var fieldInfo = typeof(FormBuilderControlType).GetField(type.ToString());

            if (fieldInfo != null)
            {
                var metadataAttribute = Attribute.GetCustomAttribute(fieldInfo, typeof(FormBuilderControlMetadata)) as FormBuilderControlMetadata;

                return(metadataAttribute);
            }

            return(null);
        }
Пример #2
0
        public static FormBuilderControlDisplay GetDisplayAttribute(this FormBuilderControlType type)
        {
            var fieldInfo = typeof(FormBuilderControlType).GetField(type.ToString());

            if (fieldInfo != null)
            {
                var displayAttribute = Attribute.GetCustomAttribute(fieldInfo, typeof(FormBuilderControlDisplay)) as FormBuilderControlDisplay;

                return(displayAttribute);
            }

            return(null);
        }