By appSettings-like I mean like this,
<appSettings>
<add key="myKey" value="myValue" />
</appsettings>
The result is a key-value collection that I can access like:
string v = config["myKey"];
but it is not necessarily located in app.config, so what I have is a string or a XmlNode.
NameValueFileSectionHandler.Create method apparently can do the job, but the input needs two objects, Object parent, Object configContext, in addition to a xml node, and I don’t know what to pass to them.
Parse a string to a dictionary like this,
You can get the values like this,
You can also modify the values in the dictionary like this,
And you can convert the modified dictionary back to a XElement using this code,