private void FillForm() { //this is not refined enough to be called more than once on the form because it will not //remember the toolbars that were selected. ToolButItems.Refresh(); ProgramProperties.Refresh(); textProgName.Text = ProgramCur.ProgName; textProgDesc.Text = ProgramCur.ProgDesc; checkEnabled.Checked = ProgramCur.Enabled; textPath.Text = ProgramCur.Path; textCommandLine.Text = ProgramCur.CommandLine; textNote.Text = ProgramCur.Note; ToolButItems.GetForProgram(ProgramCur.ProgramNum); listToolBars.Items.Clear(); for (int i = 0; i < Enum.GetNames(typeof(ToolBarsAvail)).Length; i++) { listToolBars.Items.Add(Enum.GetNames(typeof(ToolBarsAvail))[i]); } for (int i = 0; i < ToolButItems.ForProgram.Count; i++) { listToolBars.SetSelected((int)((ToolButItem)ToolButItems.ForProgram[i]).ToolBar, true); } if (ToolButItems.ForProgram.Count > 0) //the text on all buttons will be the same for now { textButtonText.Text = ((ToolButItem)ToolButItems.ForProgram[0]).ButtonText; } ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); listProperties.Items.Clear(); for (int i = 0; i < ProgramPropertiesForProgram.Count; i++) { listProperties.Items.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyDesc + ": " + ((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyValue); } }
private void listProperties_DoubleClick(object sender, System.EventArgs e) { if (listProperties.SelectedIndex == -1) { return; } //ProgramProperty ProgramPropertyCur= FormProgramProperty FormPP = new FormProgramProperty(); FormPP.ProgramPropertyCur = (ProgramProperty)ProgramPropertiesForProgram[listProperties.SelectedIndex]; FormPP.ShowDialog(); if (FormPP.DialogResult != DialogResult.OK) { return; } ProgramProperties.Refresh(); ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); listProperties.Items.Clear(); for (int i = 0; i < ProgramPropertiesForProgram.Count; i++) { listProperties.Items.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyDesc + ": " + ((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyValue); } }