void AddSecurityAttribute (ICustomAttributeProvider provider, AttributeType type)
{
if (HasSecurityAttribute (provider, type))
return;
var attributes = provider.CustomAttributes;
switch (type) {
case AttributeType.Critical:
attributes.Add (CreateCriticalAttribute ());
break;
case AttributeType.SafeCritical:
attributes.Add (CreateSafeCriticalAttribute ());
break;
}
}