开发者

How to write all three values using the resxresourcewriter?

开发者 https://www.devze.com 2023-03-05 13:57 出处:网络
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

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开发者_Go百科 manipulate the XML directly?


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]")

0

精彩评论

暂无评论...
验证码 换一张
取 消