private void addToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewMain.SelectedItems.Count == 0) { MessageBox.Show("Please select the position of the instruction you want to insert!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } InstructionForm insForm = new InstructionForm(curFuncName); insForm.ShowDialog(); if (insForm.Confirm) { } }
private void editToolStripMenuItem1_Click(object sender, EventArgs e) { if (listViewMain.SelectedItems.Count == 0) { MessageBox.Show("Please select the instruction you want to edit!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } InstructionForm insForm = new InstructionForm(curFunction.Code[listViewMain.SelectedIndices[0]], listViewMain.SelectedIndices[0], curFuncName); insForm.ShowDialog(); if (insForm.Confirm) { curFunction.Code.RemoveAt(listViewMain.SelectedIndices[0]); curFunction.Code.Insert(insForm.Index, insForm.Result); Global.luaFile.SetFunction(curFunction, curFuncName); UpdateControls(); } }