예제 #1
0
        void m_viewModel_UpdateTaskProgress(uint arg1, IVX.DataModel.E_VDA_TASK_STATUS arg2, uint arg3)
        {
            if (!m_isInited)
            {
                return;
            }

            if (InvokeRequired)
            {
                this.Invoke(new Action <uint, IVX.DataModel.E_VDA_TASK_STATUS, uint>(m_viewModel_UpdateTaskProgress), arg1, arg2, arg3);
            }
            else
            {
                ucTaskInfo taskinfo = null;
                try
                {
                    taskinfo = ShownTaskList.Single(item => item.Name == "buttonItemTask_" + arg1);
                }
                catch (Exception)
                {
                    //BuildTaskList();
                    return;
                }
                if (taskinfo != null)
                {
                    taskinfo.Progress = (int)arg3;
                    taskinfo.TaskStat = arg2;
                    if (m_currentShownTask != null && m_currentShownTask.Created && m_currentShownTask.TaskId == arg1)
                    {
                        m_currentShownTask.UpdateProgress(arg2, (int)arg3);
                    }
                }
                //if (taskinfo.TaskStat >= (uint)IVX.DataModel.E_VDA_TASK_STATUS.E_TASK_STATUS_IMPORT_FAILED)
                //{
                //    if (m_localUploadProgress.ContainsKey(arg1))
                //        m_localUploadProgress.Remove(arg1);
                //}
                //if (m_localUploadProgress.ContainsKey(arg1))
                //    m_localUploadProgress[arg1] =Math.Max(m_localUploadProgress[arg1] , arg3);
            }
        }
        void m_viewModel_UpdateTaskProgress(int index, uint arg1, IVX.DataModel.E_VDA_TASK_STATUS arg2, uint arg3)
        {
            if (isClosed)
            {
                return;
            }

            if (InvokeRequired)
            {
                this.Invoke(new Action <int, uint, IVX.DataModel.E_VDA_TASK_STATUS, uint>(m_viewModel_UpdateTaskProgress), index, arg1, arg2, arg3);
            }
            else
            {
                ucSingleHistoryTask taskinfo = null;
                try
                {
                    if (flowLayoutPanel1.Controls.ContainsKey("ucSingleHistoryTask_" + index))
                    {
                        taskinfo = flowLayoutPanel1.Controls["ucSingleHistoryTask_" + index] as ucSingleHistoryTask;
                    }
                    if (taskinfo != null)
                    {
                        TaskInfoV3_1 ti = (arg1 == 0)?null:m_viewModel.GetTaskInfo(arg1);
                        taskinfo.Init(ti, arg2, (int)arg3);
                        if (m_currentShownTask != null && m_currentShownTask.Created && m_currentShownTask.TaskId == arg1)
                        {
                            m_currentShownTask.UpdateProgress(arg2, (int)arg3, ti.Order, ti.LeftTime);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MyLog4Net.Container.Instance.Log.Error("m_viewModel_UpdateTaskProgress" + ex);

                    return;
                }
            }
        }