static string GetLabel(Taxonomy.Concept concept, string labelRole) { Taxonomy.LabelCollection labels; // Try to find a English label with the given labelRole if (labelRole != null) { labels = concept.GetLabels(labelRole, null, "en"); if (labels.Count > 0) { return(labels.First().Text); } } // Try to find a standard English label labels = concept.GetLabels("http://www.xbrl.org/2003/role/label", null, "en"); if (labels.Count > 0) { return(labels.First().Text); } // Fallback to any other label that is assigned to the concept labels = concept.Labels; if (labels.Count > 0) { return(labels.First().Text); } // If there are no labels, display the concept QName return(concept.QName.ToString()); }
static string GetLabel(Taxonomy.Concept concept) { // Try to find a standard English label var labels = concept.GetLabels("http://www.xbrl.org/2003/role/label", null, "en"); if (labels.Count > 0) { return(labels.First().Text); } // Fallback to any other label that is assigned to the concept labels = concept.Labels; if (labels.Count > 0) { return(labels.First().Text); } // If there are no labels, display the concept QName return(concept.QName.ToString()); }