Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write all three values using the resxresourcewriter?

http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx

In this link and others like it, I see code to write in the "name" and "value" but not the "comment". I use the comment field heavily. Is there code for accessing all 3 simultaneously or the comment field individually? Or do I have to manipulate the XML directly?

like image 904
dotnetN00b Avatar asked May 13 '11 18:05

dotnetN00b


1 Answers

Apparently you can set the comment on a ResXDataNode object. You can then write the ResXDataNode with the ResXResourceWriter.AddResource(ResXDataNode) method.

resxWriter.AddResource(new ResXDataNode("key", "value") { Comment="comment" });

Source: http://www.codeproject.com/KB/dotnet/ResxSync.aspx?msg=1708100 (after the main article, comment "Comments ARE accesible [modified]")

like image 130
Tao Avatar answered Nov 06 '22 17:11

Tao