public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
{
if (a.Type == pa.AttributeUsage) {
if (!BaseType.IsAttribute && spec != TypeManager.attribute_type) {
Report.Error (641, a.Location, "Attribute `{0}' is only valid on classes derived from System.Attribute", a.GetSignatureForError ());
}
}
if (a.Type == pa.Conditional && !BaseType.IsAttribute) {
Report.Error (1689, a.Location, "Attribute `System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes");
return;
}
if (a.Type == pa.ComImport && !attributes.Contains (pa.Guid)) {
a.Error_MissingGuidAttribute ();
return;
}
if (a.Type == pa.Extension) {
a.Error_MisusedExtensionAttribute ();
return;
}
if (a.Type.IsConditionallyExcluded (Location))
return;
base.ApplyAttributeBuilder (a, ctor, cdata, pa);
}