对于我正在尝试做的事情,我不确定所有正确的术语,所以我将深入研究一些代码。
当前设置
public enum NavigationLinks
{
[FriendlyName("System Dashboard")]
SystemDashboard,
[FriendlyName("Trading Dashboard")]
TradingDashboard,
}
public class UINameAttribute : Attribute
{
public string Value { get; private set; }
public UINameAttribute(string Value)
{
this.Value = Value;
}
}
我想要什么
public enum NavigationLinks
{
[FriendlyName]
SystemDashboard,
[FriendlyName]
TradingDashboard,
}
public class UINameAttribute : Attribute
{
public string Value { get; private set; }
public UINameAttribute(string Value)
{
this.Value = Value;
}
public UINameAttribute()
{
string AttributedValue = this.AttributedObject.ToString();
// Take the value of the attribute and add a space in between the camel case.
}
}
基本上-我想知道是否可以从属性的构造函数中访问该属性所在的底层“事物”-
提前致谢!威廉