Skip to content

Commit 993519f

Browse files
Add support for new InputFromDescription attribute (#3511)
2 parents b9103e1 + 9b45d5b commit 993519f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Reflection_Engine/Query/Description.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,28 @@ public static string Description(this ParameterInfo parameter, bool addTypeDescr
109109
return prop.Description();
110110
}
111111
}
112+
else
113+
{
114+
InputFromDescription inputFromDesc = parameter.Member.GetCustomAttributes<InputFromDescription>().FirstOrDefault(x => x.InputName == parameter.Name);
115+
if (inputFromDesc != null)
116+
{
117+
desc = inputFromDesc.Member?.IDescription() ?? "";
118+
119+
if (addTypeDescription)
120+
{
121+
if (inputFromDesc.Classification != null)
122+
classification = inputFromDesc.Classification;
123+
124+
desc += parameter.ParameterType.Description(classification);
125+
}
126+
127+
return desc;
128+
}
129+
}
112130
}
131+
132+
133+
113134
if (addTypeDescription && parameter.ParameterType != null)
114135
{
115136
desc += parameter.ParameterType.Description(classification);

0 commit comments

Comments
 (0)