Пример #1
0
        private FieldConfig GetConfig(Type type, FieldInfo field)
        {
            FieldConfig config = new FieldConfig
            {
                Name       = field.Name,
                ConfigType = field.FieldType,
                TypeName   = field.FieldType.GetTypeName()
            };

            GetInfo(config, type, field);
            return(config);
        }
Пример #2
0
        private static void CheckParameter(ParameterInfo para, MethodConfig info)
        {
            var paraInfo = new FieldConfig
            {
                Name     = para.Name,
                TypeName = para.ParameterType.GetTypeName()
            };

            if (para.HasDefaultValue)
            {
                paraInfo.DefaultValue = para.DefaultValue == null ? "null" : para.DefaultValue.ToString();
            }
            GetExtendValue(para, paraInfo);
            CheckAttributes(paraInfo, para.GetCustomAttributesData());
            info.Argument.Add(paraInfo.Name, paraInfo);
        }