- if ((mod_flags & PUBLIC) != 0 && parent.IsTopLevel == true)
- t |= TypeAttributes.Public;
- else if ((mod_flags & PUBLIC) != 0)
- t |= TypeAttributes.NestedPublic;
-
- if ((mod_flags & PRIVATE) != 0 && parent.IsTopLevel == true)
- t |= TypeAttributes.NotPublic;
- else if ((mod_flags & PRIVATE) != 0)
- t |= TypeAttributes.NestedPrivate;
-
- if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0 && parent.IsTopLevel == false)
- t |= TypeAttributes.NestedFamANDAssem;
- if ((mod_flags & PROTECTED) != 0 && parent.IsTopLevel == false)
- t |= TypeAttributes.NestedFamily;
- if ((mod_flags & INTERNAL) != 0 && parent.IsTopLevel == false)
- t |= TypeAttributes.NestedAssembly;
+ if (top_level){
+ if ((mod_flags & PUBLIC) != 0)
+ t |= TypeAttributes.Public;
+ if ((mod_flags & PRIVATE) != 0)
+ t |= TypeAttributes.NotPublic;
+ } else {
+ if ((mod_flags & PUBLIC) != 0)
+ t |= TypeAttributes.NestedPublic;
+ if ((mod_flags & PRIVATE) != 0)
+ t |= TypeAttributes.NestedPrivate;
+ if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0)
+ t |= TypeAttributes.NestedFamORAssem;
+ if ((mod_flags & PROTECTED) != 0)
+ t |= TypeAttributes.NestedFamily;
+ if ((mod_flags & INTERNAL) != 0)
+ t |= TypeAttributes.NestedAssembly;
+ }