private static void CheckParameters (object element, Type attributeType)
{
// neither parameter is allowed to be null
if (element == null)
throw new ArgumentNullException ("element");
if (attributeType == null)
throw new ArgumentNullException ("attributeType");
if (!typeof (Attribute).IsAssignableFrom (attributeType))
throw new ArgumentException (Locale.GetText (
"Type is not derived from System.Attribute."), "attributeType");
}