PintaProject / Pinta

Simple GTK# Paint Program
http://www.pinta-project.com/
MIT License
1.74k stars 267 forks source link

Wrote extension intended to simplify code that deals with XML elements #790

Closed Lehonti closed 2 months ago

Lehonti commented 2 months ago

If an element is created with this extension method, the IDisposable returned closes the element.

cameronwhite commented 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

Lehonti commented 2 months ago

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.