private void btnImport_Click(object sender, EventArgs e) { try { VDFParser parser = new VDFParser(); ParentKey parent = parser.Parse(new StreamReader(File.Open(desktopVDFFileLoc, FileMode.Open))); controllerMapping = new ControllerMapping(); controllerMapping.ParseParentKey(parent); a = new A_Button(controllerMapping); b = new B_Button(controllerMapping); x = new X_Button(controllerMapping); y = new Y_Button(controllerMapping); lbl_A_Button.Text = a.action; lbl_B_Button.Text = b.action; lbl_X_Button.Text = x.action; lbl_Y_Button.Text = y.action; } catch (Exception ex) { Console.WriteLine("Could not read file"); Console.WriteLine(ex.Message); } }
private void loadToolStripMenuItem_Click(object sender, EventArgs e) { List<ControllerComponentObject> controllerComponents = new List<ControllerComponentObject>(); OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { desktopVDFFileLoc = ofd.FileName; } VDFParser parser = new VDFParser(); ParentKey parent = parser.Parse(new StreamReader(File.Open(desktopVDFFileLoc, FileMode.Open))); controllerMapping = new ControllerMapping(); controllerMapping.ParseParentKey(parent); }