internal static ITypeReference ConvertAttributeType(AstType type) { ITypeReference tr = type.ToTypeReference(); if (!type.GetChildByRole(AstNode.Roles.Identifier).IsVerbatim) { // Try to add "Attribute" suffix, but only if the identifier // (=last identifier in fully qualified name) isn't a verbatim identifier. SimpleTypeOrNamespaceReference st = tr as SimpleTypeOrNamespaceReference; MemberTypeOrNamespaceReference mt = tr as MemberTypeOrNamespaceReference; if (st != null) return new AttributeTypeReference(st, st.AddSuffix("Attribute")); else if (mt != null) return new AttributeTypeReference(mt, mt.AddSuffix("Attribute")); } return tr; }