How to Get (Value or Comment) from a resource item in C# Resource Files into an attribute?

141 views Asked by At

I want to get value from resource into the DefaultValue Attribute in C#? Is it possible and how it works if it is possible?

Example like code below

[DefaultValue(value:(Resources.ColorResource.Red))]

The resource file contains below values

enter image description here

The Value of "Red" key in resources is going to use like below picture

enter image description here

And as you can see in second image the Value keword and Comment keyword are incorrect. So how is it possible to use them like the example code?

0

There are 0 answers