private void btn_browse_mapperFile_Click(object sender, RoutedEventArgs e) { try { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Mapper XML files (*.XMLMapper)|*.XMLMapper|CSV Mapper (*.CSVMapper1)|*.CSVMapper1"; // "Mapper files (*.Mapper)|*.map"; ofd.RestoreDirectory = true; DialogResult sdResult = ofd.ShowDialog(); foreach (string file in ofd.FileNames) { //extract the data from the selected file. GH.getFileObject(file, "mapper"); } //set that file to the combobox cBox_Mapper.SelectedIndex = cBox_Mapper.Items.Count - 1; C3D_2016_Anno.Global.fileItem FI = (C3D_2016_Anno.Global.fileItem)cBox_Mapper.SelectedItem; GH.getMapper(FI.filePath); //set that file to the combobox UIH.toastIT("Mapper files read sucessfully!", "File Read", NotificationType.Information); } catch (System.Exception ee) { GH.writeLog(ee.ToString()); } }
private void btn_browse_templateFile_Click(object sender, RoutedEventArgs e) { try { // Create an instance of the open file dialog box. OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Note list XML files (*.XMLNotes)|*.XMLNotes|CSV Notes without double quotes (*.CSVNotes1)|*.CSVNotes1|CSV Notes with double quotes (*.CSVNotes2)|*.CSVNotes2"; //"XML files (*.xml)|*.def"; ofd.RestoreDirectory = true; DialogResult sdResult = ofd.ShowDialog(); if (sdResult != System.Windows.Forms.DialogResult.OK) { return; } foreach (string file in ofd.FileNames) { //if the file dont exits add //extract the data from the selected file. GH.getFileObject(file, "template"); } //set that file to the combobox cBox_template.SelectedIndex = cBox_template.Items.Count - 1; C3D_2016_Anno.Global.fileItem FI = (C3D_2016_Anno.Global.fileItem)cBox_template.SelectedItem; GH.getTemplateDetails(FI.filePath); UIH.toastIT("Note list files read sucessfully!", "File Read", NotificationType.Information); } catch (System.Exception ee) { GH.writeLog(ee.ToString()); } }