gruber
gruber

Reputation: 29719

Get access to resx file

In my project I have resx file. MyFile.resx

If I use in my code:

MyFile.PropertyOneName; MyFile.PropertyTwoName

Everything works great and I can have access to these properties values

But what if I want to pass string parameter as a propertyName and get that by reflection:

typeof(MyFile).GetProperties returns 0 elements while I have a lot properties in it :/

any suggestions ?

Upvotes: 1

Views: 808

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

MyFile.ResourceManager.GetString("PropertyOneName", MyFile.Culture)

Upvotes: 3

Related Questions