private void cb_setups_SelectedIndexChanged(object sender, EventArgs e) { SetupInfo selected_setup = Variables.setups_info[cb_setups.SelectedIndex]; this.cb_export_nc.Checked = selected_setup.options.is_export_nc; this.cb_export_tools.Checked = selected_setup.options.is_export_tools; this.tb_setup_template_fpath.Text = selected_setup.options.template_fpath; if (this.tb_setup_template_fpath.Text != "") { Variables.setups_info[cb_setups.SelectedIndex].attach_components = FindAllAttachComponents(Path.GetFullPath(this.tb_setup_template_fpath.Text)); Variables.setups_info[cb_setups.SelectedIndex].attach_components.Sort(); Variables.setups_info[cb_setups.SelectedIndex].subsystems = VericutMachineReader.GetMachineSubsystems(Path.GetFullPath(this.tb_setup_template_fpath.Text)); } else if (this.tb_proj_template_fpath.Text != "") { Variables.setups_info[cb_setups.SelectedIndex].attach_components = FindAllAttachComponents(Path.GetFullPath(this.tb_proj_template_fpath.Text)); Variables.setups_info[cb_setups.SelectedIndex].attach_components.Sort(); Variables.setups_info[cb_setups.SelectedIndex].subsystems = VericutMachineReader.GetMachineSubsystems(Path.GetFullPath(this.tb_proj_template_fpath.Text)); } }
private void b_select_template_Click(object sender, EventArgs e) { openProjectFileDialog1.Filter = LanguageSupport.Translate("VCPROJECT file (*.vcproject)|*.vcproject"); openProjectFileDialog1.FileName = ""; openProjectFileDialog1.CheckFileExists = true; openProjectFileDialog1.Title = LanguageSupport.Translate("Select template VERICUT project"); if (openProjectFileDialog1.ShowDialog() == DialogResult.OK) { tb_proj_template_fpath.Text = openProjectFileDialog1.FileName; Variables.doc_options.vc_template_proj_fpath = tb_proj_template_fpath.Text; Variables.doc_options.vc_template_proj_fpath = tb_proj_template_fpath.Text; Variables.doc_options.is_export_project = (tb_proj_template_fpath.Text != ""); if (cb_setups.SelectedIndex >= 0) { if (this.tb_setup_template_fpath.Text == "" && this.tb_proj_template_fpath.Text != "") { Variables.setups_info[cb_setups.SelectedIndex].attach_components = FindAllAttachComponents(Path.GetFullPath(this.tb_proj_template_fpath.Text)); Variables.setups_info[cb_setups.SelectedIndex].attach_components.Sort(); Variables.setups_info[cb_setups.SelectedIndex].subsystems = VericutMachineReader.GetMachineSubsystems(Path.GetFullPath(this.tb_proj_template_fpath.Text)); } } } }