public void DumpImage(WzImage img, string mainDir) { Form.UpdateToolstripStatus("Dumping " + img.Name + ".xml to " + mainDir); using (StreamWriter sw = new StreamWriter(ExtractPath + "\\" + mainDir + "\\" + img.Name + ".xml")) { using (XmlWriter xmlWriter = XmlWriter.Create(sw, XmlSettings)) { xmlWriter.WriteStartDocument(true); xmlWriter.WriteStartElement("imgdir"); xmlWriter.WriteStartAttribute("name"); xmlWriter.WriteValue(img.Name); CurrentImageDir = Path.Combine(mainDir, img.Name); DumpData(xmlWriter, img.WzProperties, CurrentImageDir); xmlWriter.WriteEndElement(); xmlWriter.WriteEndDocument(); } } img.PartialDispose(); }