コード例 #1
0
        //开始清洗工作并开始计时
        public void StartTask(TaskInfo info)
        {
            try
            {
                EXListView iTaskList = TaskList[info.Group];
                if (iTaskList.InvokeRequired)
                {
                    UpdateTaskList updatedelegate = new UpdateTaskList(StartTask);
                    ParentForm.Invoke(updatedelegate, new object[] { info });
                }
                else
                {
                    ListViewItem foundItem = iTaskList.FindItemWithText(info.Card, true, 0);    //参数1:要查找的文本;参数2:是否子项也要查找;参数3:开始查找位置

                    {
                        foundItem.SubItems[3].Text = info.errorInfo;
                    }
                    if (info.bStart)
                    {
                        if (info.Step > 1)
                        {
                            EXControlListViewSubItem Stopsubitem = foundItem.SubItems[info.Step + 2] as EXControlListViewSubItem;
                            SkinProgressBar          Stopp       = Stopsubitem.MyControl as SkinProgressBar;
                            progressList.Add(Stopp);
                        }

                        EXControlListViewSubItem subitem = foundItem.SubItems[info.Step + 3] as EXControlListViewSubItem;
                        SkinProgressBar          p       = subitem.MyControl as SkinProgressBar;
                        p.Maximum = info.Time * 10;
                        Thread th = new Thread(new ParameterizedThreadStart(UpdateProgressBarMethod));
                        th.IsBackground = true;
                        th.Start(p);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(typeof(Exception), ex);
            }
        }
コード例 #2
0
        public void Endupdate(TaskInfo info)
        {
            EXListView iTaskList = TaskList[info.Group];

            if (iTaskList.InvokeRequired)
            {
                UpdateTaskList updatedelegate = new UpdateTaskList(Endupdate);
                ParentForm.Invoke(updatedelegate, new object[] { info });
            }
            else
            {
                ListViewItem foundItem = iTaskList.FindItemWithText(info.Card, false, 0);    //参数1:要查找的文本;参数2:是否子项也要查找;参数3:开始查找位置

                for (int i = 4; i < iTaskList.Columns.Count; i++)
                {
                    EXControlListViewSubItem subitem = foundItem.SubItems[i] as EXControlListViewSubItem;
                    iTaskList.RemoveControlFromSubItem(subitem);
                }

                iTaskList.Items.Remove(foundItem);
            }
        }
コード例 #3
0
 private void EndTask(TaskInfo info)
 {
     EXListView   iTaskList = TaskList[info.Group];
     ListViewItem foundItem = iTaskList.FindItemWithText(info.Card, true, 0);    //参数1:要查找的文本;参数2:是否子项也要查找;参数3:开始查找位置
 }