private void toolStripButton6_Click(object sender, EventArgs e) { if (current == null) { MessageBox.Show("Select a Gate"); } else { newGate = current.Clone(); } }
/// <summary> /// Copies the selected Gate and creates a new gate. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonCopy_Click(object sender, EventArgs e) { //Clone the selected gate if (current != null) { newGate = current.Clone(); Debug.WriteLine("Copy of " + newGate.GetType().Name + " added to circuit."); } //If a gate is not selected else if (current == null) { newGate = null; MessageBox.Show("Please select a gate to copy."); } }