private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            var runTime = tbKeepTime.Text;

            foreach (LBMsg msg in lBModel.ListLBMsg)
            {
                msg.KeepTime = Convert.ToInt16(runTime);
                LightBoxHelper.updateModelLBMsg(msg);
            }
            WriteXmlHelper.saveModel(lBModel);
            Close();
        }
Beispiel #2
0
 private void setListBox(List <LightBox> listSelectedBox)
 {
     if (listSelectedBox.Count > 0)
     {
         WidLightBoxEdit wid = new WidLightBoxEdit(listSelectedBox[0].lBMsg);
         wid.ShowDialog();
         if (wid.DialogResult == true)
         {
             double waitTime = wid.waitTime;
             Color  color    = Colors.Gray;
             foreach (LightBox box in lightBoxes)
             {
                 if (box.lBMsg.WaitTime == waitTime)
                 {
                     color = box.oldColor;
                     break;
                 }
             }
             if (color == Colors.Gray)
             {
                 color = GetRandomColor();
             }
             foreach (LightBox box in listSelectedBox)
             {
                 box.lBMsg.WaitTime    = waitTime;
                 box.lBMsg.RunTime     = wid.runTime;
                 box.lBMsg.KeepTime    = wid.keepTime;
                 box.lBMsg.RepeatCount = wid.repeatCount;
                 box.refresh();
                 box.setSelected();
                 box.setBackGroundColor(color);
                 LightBoxHelper.updateModelLBMsg(box.lBMsg);
             }
         }
     }
 }