public static clsWork NewWork() { char lcReply; InputBox inputBox = new InputBox("Enter P for Painting, S for Sculpture and H for Photograph"); //inputBox.ShowDialog(); //if (inputBox.getAction() == true) if (inputBox.ShowDialog() == System.Windows.Forms.DialogResult.OK) { lcReply = Convert.ToChar(inputBox.getAnswer()); switch (char.ToUpper(lcReply)) { case 'P': return(new clsPainting()); case 'S': return(new clsSculpture()); case 'H': return(new clsPhotograph()); default: return(null); } } else { inputBox.Close(); return(null); } }
private void btnAdd_Click(object sender, EventArgs e) { char lcReply; InputBox inputBox = new InputBox("Enter P for Painting, S for Sculpture and H for Photograph"); //inputBox.ShowDialog(); //if (inputBox.getAction() == true) if (inputBox.ShowDialog() == System.Windows.Forms.DialogResult.OK) { lcReply = Convert.ToChar(inputBox.getAnswer()); _WorksList.AddWork(lcReply); UpdateDisplay(); } }
public static clsWork NewWork() { char lcReply; InputBox inputBox = new InputBox("Enter P for Painting, S for Sculpture and H for Photograph"); //inputBox.ShowDialog(); //if (inputBox.getAction() == true) if (inputBox.ShowDialog() == System.Windows.Forms.DialogResult.OK) { lcReply = Convert.ToChar(inputBox.getAnswer()); switch (char.ToUpper(lcReply)) { case 'P': return new clsPainting(); case 'S': return new clsSculpture(); case 'H': return new clsPhotograph(); default: return null; } } else { inputBox.Close(); return null; } }