private void mExternEditOnClick(object obj, EventArgs ea) { //edit item if (Extern.SelectedItems.Count == 1) { addFilesDialog dlg = new addFilesDialog(Extern.SelectedItems[0].Text,Extern.SelectedItems[0].SubItems[1].Text); if (dlg.ShowDialog() == DialogResult.OK) { Extern.SelectedItems[0].Text = dlg.name; Extern.SelectedItems[0].SubItems[1].Text = dlg.location; } } }
//Extern menu stuff private void mExternAddOnClick(object obj, EventArgs ea) { //add item addFilesDialog dlg = new addFilesDialog("",""); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.name != "") { ListViewFileItem itm = new ListViewFileItem(); itm.Text = dlg.name; itm.SubItems.Add(dlg.location); Extern.Items.Add(itm); } } }
private void mEditOnClick(object obj, EventArgs ea) { if (files.SelectedItems.Count == 1) { //edit item int i = 0; if (files.SelectedItems[0].SubItems[1].Text == ActionStrings.Remove) i = 1; addFilesDialog dlg = new addFilesDialog(files.SelectedItems[0].Text,files.SelectedItems[0].SubItems[2].Text,i); if (dlg.ShowDialog() == DialogResult.OK) { files.SelectedItems[0].Text = dlg.name; files.SelectedItems[0].SubItems[1].Text = dlg.action; files.SelectedItems[0].SubItems[2].Text = dlg.location; } } }
private void mInterEditOnClick(object obj, EventArgs ea) { //edit item if (Intern.SelectedItems.Count == 1 && Intern.SelectedItems[0].SubItems[1].Text != ListViewStrings.LocationExe) { addFilesDialog dlg = new addFilesDialog(Intern.SelectedItems[0].Text,Intern.SelectedItems[0].SubItems[1].Text); if (dlg.ShowDialog() == DialogResult.OK) { Intern.SelectedItems[0].Text = dlg.name; Intern.SelectedItems[0].SubItems[1].Text = dlg.location; } } }
private void mAddOnClick(object obj, EventArgs ea) { //add item addFilesDialog dlg = new addFilesDialog("","",0); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.name != "") { ListViewFileItem itm = new ListViewFileItem(); itm.Text = dlg.name; itm.SubItems.Add(dlg.action); itm.SubItems.Add(dlg.location); //set offset and size to -1 so whole file added to patch itm.Offset = -1; itm.Size = -1; files.Items.Add(itm); } } }