Multiline Support for Arrays Keys
Hi, thanks for this wonderful tool.
I am trying to get an array key spanned to multiple lines.
Like this:
[Sources]
Files = {
"....File1.txt",
"....File2.txt",
"....File3.txt"}
But I am getting a Setting Assignment Parse Exception. I have to do this in multi-lines because I need to parse multiple files and making the user place all files on a single line could be a little weird.
Any thoughts on this?
Thanks in advance.
Hi Jose, there already is a plan to improve the parser in this regard. If you need a workaround for now, I suggest you read your configuration file in as a string. Then, search for the start and end position of the {"File1", "File2", ...} portion and replace the newlines within this portion, thus creating a string that is parsable for SharpConfig. You can then load the configuration using Configuration.LoadFromString() and passing that string.
Since there are other issues open right now, I think it's time so release a new version in the upcoming days/weeks.
Let me know if that helped, cheers.
Hi Cem, thanks for the response and the tip.
I will be trying that and I will let you know how it went.
Thanks.