public frmParticles(frmMain aMainForm) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // mMainForm = aMainForm; mlstParticles = new ArrayList(); mlstTypes = new ArrayList(); XmlDocument Doc = new XmlDocument(); try { Doc.Load("MapEditor.cfg"); } catch (XmlException e) { MessageBox.Show("Couldn't load 'MapEditor.cfg'!\n" + e.ToString(), "Error"); return; } XmlElement CfgElem = (XmlElement)Doc.FirstChild; foreach (XmlElement CfgElemChild in CfgElem.ChildNodes) { if (CfgElemChild.Name == "ParticleSystems") { foreach (XmlElement PartElem in CfgElemChild.ChildNodes) { cParticleType PType = new cParticleType(); PType.msName = cHplXml.GetStr(PartElem, "Name", ""); PType.msDesc[0] = cHplXml.GetStr(PartElem, "XDesc", ""); PType.msDesc[1] = cHplXml.GetStr(PartElem, "YDesc", ""); PType.msDesc[2] = cHplXml.GetStr(PartElem, "ZDesc", ""); objTypeList.Items.Add(PType.msName); mlstTypes.Add(PType); objTypeList.SelectedIndex = 0; } break; } } }
public frmParticles(frmMain aMainForm) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // mMainForm = aMainForm; mlstParticles = new ArrayList(); mlstTypes = new ArrayList(); XmlDocument Doc = new XmlDocument(); try { Doc.Load("MapEditor.cfg"); } catch(XmlException e) { MessageBox.Show("Couldn't load 'MapEditor.cfg'!\n"+e.ToString(), "Error"); return; } XmlElement CfgElem = (XmlElement)Doc.FirstChild; foreach(XmlElement CfgElemChild in CfgElem.ChildNodes) { if(CfgElemChild.Name == "ParticleSystems") { foreach(XmlElement PartElem in CfgElemChild.ChildNodes) { cParticleType PType = new cParticleType(); PType.msName = cHplXml.GetStr(PartElem,"Name",""); PType.msDesc[0] = cHplXml.GetStr(PartElem,"XDesc",""); PType.msDesc[1] = cHplXml.GetStr(PartElem,"YDesc",""); PType.msDesc[2] = cHplXml.GetStr(PartElem,"ZDesc",""); objTypeList.Items.Add(PType.msName); mlstTypes.Add(PType); objTypeList.SelectedIndex =0; } break; } } }