예제 #1
0
        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);
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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;
             }
        }