private void button3_Click(object sender, EventArgs e) { if (rdbAssignFree.Checked) { int newProto = ProtoManager.AddProto(); RefreshList(); frmProtoCritterEditor form = new frmProtoCritterEditor(this, newProto, true); form.Show(); } else { if (ProtoManager.AddProto((int)numPid.Value)) { RefreshList(); frmProtoCritterEditor form = new frmProtoCritterEditor(this, (int)numPid.Value, true); form.Show(); } } }
private void protoList_KeyUp(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.C) { Object obj = protoList.SelectedObject; if (obj != null) { var kvp = (KeyValuePair <int, ProtoCritter>)obj; copiedCritter = (ProtoCritter)kvp.Value; lblCopied.Text = getCopiedText(); } e.Handled = true; } else if (e.Control && e.KeyCode == Keys.V) { ProtoCritter cr = copiedCritter.DeepCopy(); ProtoManager.AddProto(cr); RefreshList(); lblCopied.Text = getCopiedText() + " Cloned into PID " + cr.Id; e.SuppressKeyPress = true; } }