//
// Applies the attributes to the `builder'.
- //
+ //
public static void ApplyAttributes (EmitContext ec, object builder, object kind,
Attributes opt_attrs, Location loc)
{
mb.SetImplementationFlags (MethodImplAttributes.PreserveSig);
return mb;
- }
-
+ }
}
public class AttributeSection {
if (a != null)
AttributeSections.Add (a);
}
+
+ public void AddAttributeSection (AttributeSection a)
+ {
+ if (a != null && !AttributeSections.Contains (a))
+ AttributeSections.Add (a);
+ }
+
+ public bool Contains (Type t)
+ {
+ foreach (AttributeSection attr_section in AttributeSections){
+ foreach (Attribute a in attr_section.Attributes){
+ if (a.Type == t)
+ return true;
+ }
+ }
+ return false;
+ }
}
}