private void ImgPanelMouseClick(object sender, MouseEventArgs e) { if (!(ActiveTool is null)) { var action = ActiveTool.ClickHandler(e); // if the tool is resetting or exiting, save the object if (action == ToolAction.RESET || action == ToolAction.EXIT) { objectList.Items.Add(ActiveTool.ResetAndGetObject()); } // if the tool is aborting or exiting, delete the object if (action == ToolAction.ABORT || action == ToolAction.EXIT) { CancelTool(); } } }