Closed Lehonti closed 2 months ago
Hmm, I'm not sure if I love the DisposableWriteStartElement()
naming and the more hidden behaviour..
Using XmlDocument would be fine here too I think , since the XML files are not large. But I'm not sure how worthwhile that is unless these improvements are specifically needed
No problem. I'd close this and keep it as reference.
The main idea is not having to worry about closing the tags, and in which order they are closed. I guess it'd be similar to RAII in C++, with the 'resource' being the XML tag.
If an element is created with this extension method, the
IDisposable
returned closes the element.