private void loadDefinitonsToolStripMenuItem_Click(object sender, EventArgs e) { string path = ""; OpenFileDialog FileDialog1 = new OpenFileDialog(); FileDialog1.Filter = "PropertyDef(*.xml)|*.xml"; if (FileDialog1.ShowDialog() == DialogResult.OK) { path = FileDialog1.FileName; UPR.ImportDefinitionsXML(path); RefreshView(); } }
private void importFromFileToolStripMenuItem_Click(object sender, EventArgs e) { string path = ""; OpenFileDialog FileDialog1 = new OpenFileDialog(); FileDialog1.Filter = "PropertyDef(*.xml)|*.xml"; if (FileDialog1.ShowDialog() == DialogResult.OK) { path = FileDialog1.FileName; UPropertyReader t = new UPropertyReader(); t.ImportDefinitionsXML(path); for (int i = 0; i < t.Definitions.Count; i++) { int n = -1; for (int j = 0; j < UPR.Definitions.Count; j++) { if (UPR.Definitions[j].name == t.Definitions[i].name) { n = j; break; } } if (n == -1) { System.Windows.Forms.DialogResult m = MessageBox.Show("Do you want to import class : \"" + t.Definitions[i].name + "\"?", "ME3 Explorer", MessageBoxButtons.YesNo); if (m == System.Windows.Forms.DialogResult.Yes) { UPR.Definitions.Add(t.Definitions[i]); } } else { UPropertyReader.ClassDefinition d = t.Definitions[i]; for (int j = 0; j < d.props.Count; j++) { int m = -1; for (int k = 0; k < UPR.Definitions[n].props.Count; k++) { if (d.props[j].name == UPR.Definitions[n].props[k].name) { m = j; break; } } if (m == -1) { System.Windows.Forms.DialogResult m2 = MessageBox.Show("Do you want to import the property: \"" + t.Definitions[i].props[j].name + "\" into class : \"" + t.Definitions[i].name + "\"?", "ME3 Explorer", MessageBoxButtons.YesNo); if (m2 == System.Windows.Forms.DialogResult.Yes) { UPR.Definitions[n].props.Add(t.Definitions[i].props[j]); } } } } } RefreshView(); } }
private void PropertyManager_Load(object sender, EventArgs e) { UPR = new UPropertyReader(); string loc = Path.GetDirectoryName(Application.ExecutablePath); if (File.Exists(loc + "\\exec\\DefaultProp.xml")) { UPR.ImportDefinitionsXML(loc + "\\exec\\DefaultProp.xml"); } RefreshView(); }