internal static String GetAttributeName (Type type)
{
ObjectiveCClassAttribute attribute = Attribute.GetCustomAttribute (type, typeof(ObjectiveCClassAttribute)) as ObjectiveCClassAttribute;
if (attribute == null) {
throw new ObjectiveCException (String.Format (CultureInfo.CurrentCulture, Resources.NoClassAttributeFoundForType, type));
}
String name = String.IsNullOrEmpty (attribute.Name) ? type.Name : attribute.Name;
// Native types are never mangled
if (attribute.IsNative) {
return name;
}
// Managed types other than the primary require the domain token
return ObjectiveCRuntime.GetDomainManagledName(name);
}