+ if (customattr.IsSuppressUnmanaged (code_gen))
+ classdef.AddAttribute (PEAPI.TypeAttr.HasSecurity);
+ }
+ }
+
+ /// Add declarative security to this class
+ if (decl_sec != null) {
+ decl_sec.AddTo (code_gen, classdef);
+ classdef.AddAttribute (PEAPI.TypeAttr.HasSecurity);
+ }
+
+ if (override_list != null) {
+ foreach (DictionaryEntry entry in override_list) {
+ MethodDef body = (MethodDef) entry.Key;
+ DictionaryEntry decl = (DictionaryEntry) entry.Value;
+ BaseTypeRef parent_type = (BaseTypeRef) decl.Key;
+ parent_type.Resolve (code_gen);
+ string over_name = (string) decl.Value;
+ BaseMethodRef over_meth = parent_type.GetMethodRef (body.RetType,
+ body.CallConv, over_name, body.ParamTypeList (), body.GenParamCount);
+ over_meth.Resolve (code_gen);
+ classdef.AddMethodOverride (over_meth.PeapiMethod,
+ body.PeapiMethodDef);
+ }
+ }
+
+ if (override_long_list != null) {
+ foreach (DictionaryEntry entry in override_long_list) {
+ string sig = (string) entry.Key;
+ BaseMethodRef decl = (BaseMethodRef) entry.Value;
+ MethodDef body = (MethodDef) method_table[sig];
+ decl.Resolve (code_gen);
+ classdef.AddMethodOverride (decl.PeapiMethod,
+ body.PeapiMethodDef);
+ }