init
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
using Users.UserSettings;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace DTS.Slice.Users.UserSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// this class overloads the categoryattribute to provide a localized string using our string resources
|
||||
/// we also overload it so that we can use an enum to set the attribute
|
||||
/// to be translated the category should exist in the string resources, otherwise you'll get
|
||||
/// ##ResourceNotFound## as your translated string
|
||||
/// </summary>
|
||||
public class CategoryAttributeEx : CategoryAttribute
|
||||
{
|
||||
private readonly PropertyEnums.PropertyCategories _category;
|
||||
public PropertyEnums.PropertyCategories GetCategory() { return _category; }
|
||||
|
||||
protected override string GetLocalizedString(string value)
|
||||
{
|
||||
return StringResources.ResourceManager.GetString(value) ?? "##ResourceNotFound##" + value;
|
||||
}
|
||||
|
||||
public CategoryAttributeEx(PropertyEnums.PropertyCategories category) : base(category.ToString())
|
||||
{
|
||||
_category = category;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user