public Scripts() { pre_install_cmd = new StrArr(); post_install_cmd = new StrArr(); pre_update_cmd = new StrArr(); post_update_cmd = new StrArr(); post_status_cmd = new StrArr(); pre_archive_cmd = new StrArr(); post_archive_cmd = new StrArr(); pre_autoload_dump = new StrArr(); post_autoload_dump = new StrArr(); post_root_package_install = new StrArr(); post_create_project_cmd = new StrArr(); custom = new Dictionary <string, StrArr>(); }
void StrArrFieldEnter(object sender, EventArgs e) { var formControl = (Control)sender; var dataField = (StrArr)scripts.GetType().GetField(formControl.Name).GetValue(scripts); if (dataField == null) { dataField = new StrArr(); } var form = new ListBoxForm(dataField.Values); form.ShowDialog(); formControl.Text = dataField.ToString().Trim(new [] { '"' }); scripts.GetType().GetField(formControl.Name).SetValue(scripts, dataField); ((Control)sender).Parent.SelectNextControl(ActiveControl, true, true, true, true); }