S
Shapper
Hello,
I have the following Enum:
public enum FruitsEnum {
[FruitColor("Red")]
Apple = 1,
[FruitColor("Green")]
Kiwi = 2,
[FruitColor("Yellow")]
Pear = 3
};
The FruitColor attribute is as follows:
public sealed class FruitColorAttribute : Attribute {
public String Color { get; set; }
public FruitColorAttribute(String color) {
this.Color = color;
}
}
I would like to localize the enum and if possible also the attributes.
Is it possible to create a custom TypeConverter for this?
In this TypeConverter a service would be called ...
So when I use GetNames or Parse with the custom type converter the service would translate the Enum to String or the String to Enum.
Does this make sense?
Thank You,
Miguel
I have the following Enum:
public enum FruitsEnum {
[FruitColor("Red")]
Apple = 1,
[FruitColor("Green")]
Kiwi = 2,
[FruitColor("Yellow")]
Pear = 3
};
The FruitColor attribute is as follows:
public sealed class FruitColorAttribute : Attribute {
public String Color { get; set; }
public FruitColorAttribute(String color) {
this.Color = color;
}
}
I would like to localize the enum and if possible also the attributes.
Is it possible to create a custom TypeConverter for this?
In this TypeConverter a service would be called ...
So when I use GetNames or Parse with the custom type converter the service would translate the Enum to String or the String to Enum.
Does this make sense?
Thank You,
Miguel