Skip to content

Commit 69a2c15

Browse files
committed
fix #17
Fix issue : Command flag code with 4 type attribute
1 parent 3e51d4a commit 69a2c15

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

CadAddinManager/Model/AssemLoader.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ private string ResolveDuplicateMethod(string originalFilePath)
107107
{
108108
int count = customAttribute.ConstructorArguments.Count;
109109
CustomAttribute newAttr = null;
110+
if (count == 4)
111+
{
112+
newAttr = CreateCustomAttribute4Type(customAttribute);
113+
}
110114
if (count == 3)
111115
{
112116
newAttr = CreateCustomAttribute3Type(customAttribute);
@@ -162,6 +166,28 @@ private string SaveAssemblyModifyToTemp(string originalFilePath)
162166
string fileAssemblyTemp = Path.Combine(directoryInfo3.FullName, Path.GetFileName(originalFilePath));
163167
return fileAssemblyTemp;
164168
}
169+
private CustomAttribute CreateCustomAttribute4Type(CustomAttribute customAttribute)
170+
{
171+
string valueAttribute = ResolveValueAttribute(customAttribute);
172+
return new CustomAttribute(customAttribute.Constructor)
173+
{
174+
ConstructorArguments =
175+
{
176+
new CustomAttributeArgument(
177+
customAttribute.ConstructorArguments[0].Type,
178+
valueAttribute),
179+
new CustomAttributeArgument(
180+
customAttribute.ConstructorArguments[1].Type,
181+
customAttribute.ConstructorArguments[1].Value),
182+
new CustomAttributeArgument(
183+
customAttribute.ConstructorArguments[2].Type,
184+
customAttribute.ConstructorArguments[2].Value),
185+
new CustomAttributeArgument(
186+
customAttribute.ConstructorArguments[3].Type,
187+
customAttribute.ConstructorArguments[3].Value),
188+
}
189+
};
190+
}
165191
private CustomAttribute CreateCustomAttribute3Type(CustomAttribute customAttribute)
166192
{
167193
string valueAttribute = ResolveValueAttribute(customAttribute);

0 commit comments

Comments
 (0)