Hi,
I am having a problem with the following: When attempting to apply the
DescriptionAttribute (or any attribute) to a class property (which is later
bound to a PropertyGrid) using the following syntax, everything works
properly:
DescriptionAttribute("Specifies the server manifest file name.")
Since my application has to be globalized/localized, I am attempting to
do the following which retrieves the language specific string from a resource
file:
DescriptionAttribute(My.Resources.Errors.ServerManifestFileRequired)
I receive an error stating that it requires a constant; basically
telling me that My.Resources.Errors.ServerManifestFileRequired is not a valid
string.
I have tried adding the .ToString, and the
Convert.ToString(My.Resources.Errors.ServerManifestFileRequired), but to no
avail. Can anyone help me with this?
Regards,
Giovanni
Aldo Donetti [MS] - 12 Oct 2006 23:44 GMT
Hi Giovanni, you might want to try looking at this article
<http://msdn2.microsoft.com/en-us/library/system.componentmodel.descriptionattrib
ute.descriptionvalue.aspx>
and use the DescriptionAttribute.DescriptionValue to set the localized value.
HTH
Aldo
-- This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: My.Resources DescriptionAttribute Error
| thread-index: Acbb+r9fXpQ5mKAMTGCwoUVST+Zi2g==
[quoted text clipped - 45 lines]
|
| Giovanni