public SimpleInfoEditControl(SimpleQuestionInfo info)
 {
     InitializeComponent();
     _info = new SimpleQuestionInfo(info);
     if (_info.Text != null)
     {
         textBoxText.Text = _info.Text;
     }
     if (_info.Image != null)
     {
         pictureBox1.Image         = _info.Image;
         buttonRemoveImage.Enabled = true;
     }
     else
     {
         buttonRemoveImage.Enabled = false;
     }
     if (_info.Sound != null)
     {
         buttonPlaySound.Enabled   = true;
         buttonRemoveSound.Enabled = true;
     }
     else
     {
         buttonRemoveSound.Enabled = false;
         buttonRemoveImage.Enabled = false;
     }
 }
 public SimpleInfoEditControl()
 {
     InitializeComponent();
     _info = new SimpleQuestionInfo();
     buttonPlaySound.Enabled   = false;
     buttonRemoveSound.Enabled = false;
     buttonRemoveImage.Enabled = false;
 }
 public SimpleQuestionInfo(SimpleQuestionInfo infoToClone)
 {
     Text = infoToClone.Text;
     if (infoToClone.Image != null)
     {
         Image = new Bitmap(infoToClone.Image);
     }
     if (infoToClone.Sound == null)
     {
         Sound = null;
     }
     else
     {
         Sound = (byte[])infoToClone.Sound.Clone();
     }
 }
Beispiel #4
0
 public SimpleQuestionInfoView(SimpleQuestionInfo info)
 {
     this.sound = info.Sound;
     InitializeComponent();
     if (sound != null)
     {
         sound = (byte[])info.Sound.Clone();
         buttonPlaySound.Visible = true;
     }
     else
     {
         buttonPlaySound.Visible = false;
     }
     labelVoprText.Text = info.Text;
     if (info.Image != null)
     {
         pictureBox1.Image = new Bitmap(info.Image);
     }
 }