Reputation: 873
in c# by reflection change resource file look like below:
using (ResourceWriter resourceWriter = new ResourceWriter(PathName))
{
foreach (var textItem in selectedText)
{
resourceWriter.AddResource(textItem.Id, textItem.Name);
}
}
a selectedText is List of Id and Name instead of name and value. when run test a destroy resource file and not opening.
Upvotes: 0
Views: 50
Reputation: 479
I think you are looking for ResXResourceWriter class
using (ResXResourceWriter resourceWriter = new ResXResourceWriter(PathName))
{
foreach (var textItem in selectedText)
{
resourceWriter.AddResource(textItem.Id, textItem.Name);
}
resourceWriter.Close();
}
Upvotes: 1