public static string GetNameOfType(BaseUsage usage)
{
if (usage is MetadataPackageUsage)
{
MetadataPackageUsage mpu = (MetadataPackageUsage)usage;
return mpu.MetadataPackage.Name;
}
if (usage is MetadataAttributeUsage)
{
MetadataAttributeUsage mau = (MetadataAttributeUsage)usage;
return mau.MetadataAttribute.Name;
}
if (usage is MetadataNestedAttributeUsage)
{
MetadataNestedAttributeUsage mnau = (MetadataNestedAttributeUsage)usage;
return mnau.Member.Name;
}
return "";
}