private void Btn_save_Click(object sender, EventArgs e) { string ver = tb_ver.Text.Trim(); bool isupdate = cb_update.Checked; string updatelog = textBox2.Text.Trim(); string output = lb_output.Text; string start = lb_start.Text; if (string.IsNullOrEmpty(ver)) { MessageBox.Show("The version number can't be null", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(output)) { MessageBox.Show("Did not choose the output directory, please choose the directory first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(updatelog)) { MessageBox.Show("Update log can't be null", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (lsb_files.Items.Count == 0) { MessageBox.Show("Update file list is empty, there is at least one file", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(start)) { MessageBox.Show("Please select a start the program", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } config.IsUpdate = isupdate; config.OutPut = output; config.Version = ver; SaveConfig(config); ServerOutPut sop = new ServerOutPut(); sop.Config = config; sop.UpdateLog = updatelog; sop.Files = lsb_files.Items.OfType <object>().Select(i => i.ToString()).ToList(); sop.StartPath = lb_start.Text; new OutPutForm(sop).ShowDialog(); }
public OutPutForm(ServerOutPut sp) { InitializeComponent(); SOP = sp; }