Using c#, .net 4.5.
I have a class with some properties with DisplayNameEx attribute, which is derived from DisplayNameAttibute:
public class Settings
{
[DisplayNameEx("User")]
public UserData User { get; set; }
}
public class DisplayNameExAttribute : DisplayNameAttribute
{
public DisplayNameExAttribute(string id)
{
}
}
I pass as string id ALLWAYS name of my property, so it would be easier writing code this way:
public class Settings
{
[DisplayNameEx()]
public UserData User { get; set; }
}
But I don't know, how could I resolve a property name here:
public class DisplayNameExAttribute : DisplayNameAttribute
{
public DisplayNameExAttribute()
{
// what is the property name, which called this constructor?
}
}
In addition, it would be also a class name needed (Settings in my case) here.