public static GetDefault ( string key, string defaultText ) : string | ||
key | string | Text key |
defaultText | string | Default text |
Результат | string |
protected virtual string GetEntitySingular() { if (entitySingular == null) { var attributes = this.GetType().GetCustomAttributes(typeof(ItemNameAttribute), true); if (attributes.Length >= 1) { entitySingular = attributes[0].As<ItemNameAttribute>().Value; entitySingular = LocalText.GetDefault(entitySingular, entitySingular); } else entitySingular = (Q.TryGetText(GetLocalTextPrefix() + "EntitySingular") ?? GetEntityType()); } return entitySingular; }
protected virtual string GetItemName() { if (itemName == null) { var attributes = this.GetType().GetCustomAttributes(typeof(ItemNameAttribute), true); if (attributes.Length >= 1) { itemName = attributes[0].As <ItemNameAttribute>().Value; itemName = LocalText.GetDefault(itemName, itemName); } else { itemName = (Q.TryGetText(GetLocalTextDbPrefix() + "EntitySingular") ?? GetEntityType()); } } return(itemName); }
protected virtual string GetDisplayName() { if (displayName == null) { var attributes = this.GetType().GetCustomAttributes(typeof(DisplayNameAttribute), true); if (attributes.Length >= 1) { displayName = attributes[0].As <DisplayNameAttribute>().DisplayName; displayName = LocalText.GetDefault(displayName, displayName); } else { displayName = (Q.TryGetText(GetLocalTextDbPrefix() + "EntityPlural") ?? GetEntityType()); } } return(displayName); }