Esempio n. 1
0
        public void UpdateBoostTime(Configuration.BoostTime boostTime)
        {
            if (boostTime.No <= 0)
            {
                return;
            }

            if (Action != null)
            {
                foreach (ListViewItem eachItem in lsvBoostTime.Items)
                {
                    if (eachItem.SubItems[0].Text == boostTime.No.ToString())
                    {
                        eachItem.SubItems[1].Text = boostTime.FromTime.ToString();
                        eachItem.SubItems[2].Text = boostTime.ToTime.ToString();

                        break;
                    }
                }

                foreach (var item in Action.BoostTime)
                {
                    if (item.No == boostTime.No)
                    {
                        item.FromTime = boostTime.FromTime;
                        item.ToTime   = boostTime.ToTime;

                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        public void AddBoostTime(Configuration.BoostTime boostTime)
        {
            if (Action != null)
            {
                var          no   = lsvBoostTime.Items.Count + 1;
                ListViewItem item = new ListViewItem((no).ToString());
                item.SubItems.Add(new ListViewItem.ListViewSubItem(item, boostTime.FromTime.ToString()));
                item.SubItems.Add(new ListViewItem.ListViewSubItem(item, boostTime.ToTime.ToString()));
                lsvBoostTime.Items.Add(item);

                boostTime.No = no;
                Action.BoostTime.Add(boostTime);
            }
        }