File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public static void Main (string [] args)
11
11
if ( ! type . HasCustomAttributes )
12
12
continue ;
13
13
var hasProtocolAttribute = false ;
14
+ var hasModelAttribute = false ;
14
15
CustomAttribute registerAttribute = null ;
15
16
foreach ( var ca in type . CustomAttributes ) {
16
17
if ( ca . AttributeType . Namespace != "Foundation" )
@@ -20,15 +21,22 @@ public static void Main (string [] args)
20
21
case "ProtocolAttribute" :
21
22
hasProtocolAttribute = true ;
22
23
break ;
24
+ case "ModelAttribute" :
25
+ hasModelAttribute = true ;
26
+ break ;
23
27
case "RegisterAttribute" :
24
28
registerAttribute = ca ;
25
29
break ;
26
30
}
27
31
}
28
- if ( ! hasProtocolAttribute )
32
+ if ( ! hasProtocolAttribute || ! hasModelAttribute )
29
33
continue ;
30
34
if ( registerAttribute == null )
31
35
continue ;
36
+ if ( ( bool ) registerAttribute . ConstructorArguments [ 1 ] . Value == false ) {
37
+ Console . WriteLine ( "No need to fix {0}" , type . FullName ) ;
38
+ continue ;
39
+ }
32
40
Console . WriteLine ( "Fixing {0}" , type . FullName ) ;
33
41
registerAttribute . ConstructorArguments [ 1 ] = new CustomAttributeArgument ( registerAttribute . ConstructorArguments [ 1 ] . Type , false ) ;
34
42
}
You can’t perform that action at this time.
0 commit comments