public string GetLabel(object key) { if (KeyTransformer == null || key == null) { return(null); } try { var trans = KeyTransformer.Transform(key as string, Language); if (string.IsNullOrEmpty(trans)) { trans = string.Format("{0}({1})", string.IsNullOrEmpty(KeyTransformer.UnknownLabel) ? "" : KeyTransformer.UnknownLabel + " ", key); } return(trans); } catch (Exception ex) { Log.SingleError(string.Format("Error loading label {0} ({1})", key, ex), this); return("(Error: " + key + ")"); } }