public NewEnemyWindow(XmlDocument doc, Editor editor) { NewEnemyElement = doc.CreateElement("Enemy"); NewEnemyElement.SetAttribute("name", ""); NewEnemyElement.SetAttribute("displayname", ""); NewEnemyElement.SetAttribute("type", ""); doc.DocumentElement.AppendChild(NewEnemyElement); Eject = true; parentDoc = doc; parentEditor = editor; InitializeComponent(); }
public NewEnemyWindow(XmlElement templateEnemy, Editor editor) { parentEditor = editor; try { NewEnemyElement = (XmlElement)templateEnemy.CloneNode(true); templateEnemy.ParentNode.AppendChild(NewEnemyElement); Eject = true; parentDoc = NewEnemyElement.OwnerDocument; } catch { Console.Out.WriteLine("Failed to receive an xmlelement"); } InitializeComponent(); }