示例#1
0
        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();

        }
示例#2
0
        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();


        }