private void renameDoorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (currentlySelectedObject != null &&
currentlySelectedObject is Door)
{
StringPromptDialog dialog = new StringPromptDialog("Enter the new name: ");
if (dialog.ShowDialog() == DialogResult.OK)
{
if (isDoorNameUnique(dialog.UserInput))
{
((Door)currentlySelectedObject).name = dialog.UserInput;
}
else
{
showMessage("Uniqueness Error", "A door with that name already exists in the room");
}
}
}
}