Example #1
0
        private void CloseContent(DevComponents.DotNetBar.LabelItem labelitem)
        {
            string key = labelitem.Tag.ToString();

            DevComponents.DotNetBar.ItemContainer itemContainer
                = itemPanel1.GetItem("itemContainer_" + key) as DevComponents.DotNetBar.ItemContainer;
            foreach (var btn in itemContainer.SubItems)
            {
                ucTaskInfo buttonItem = btn as ucTaskInfo;
                if (buttonItem != null)
                {
                    if (m_currentTask != null && m_currentTask.TaskId == buttonItem.TaskId)
                    {
                        m_currentTask = null;
                    }
                    if (ShownTaskList.Find(it => it.TaskId == buttonItem.TaskId) != null)
                    {
                        ShownTaskList.Remove(buttonItem);
                    }
                }
            }

            itemContainer.SubItems.Clear();
            itemPanel1.Refresh();
            if (OpenedList.Contains(labelitem.Name))
            {
                OpenedList.Remove(labelitem.Name);
            }
            labelitem.Symbol = "\uf054";
        }
Example #2
0
        private void buttonItem_DBClick(object sender, EventArgs e)
        {
            ucTaskInfo buttonItem = sender as ucTaskInfo;

            SelectOneTask(buttonItem);

            ShowSingleTask();
        }
Example #3
0
        private void SelectOneTask(ucTaskInfo buttonItem)
        {
            buttonItem.Checked = true;
            m_currentTask      = buttonItem;

            foreach (var item in ShownTaskList)
            {
                if (item.TaskId == buttonItem.TaskId)
                {
                    continue;
                }
                item.Checked = false;
            }
        }
Example #4
0
        private void buttonDel_Click(object sender, EventArgs e)
        {
            if (m_currentTask != null)
            {
                m_viewModel.DeleteTask(m_currentTask.TaskId);

                DevComponents.DotNetBar.ItemContainer itemContainer
                    = m_currentTask.Parent as DevComponents.DotNetBar.ItemContainer;
                itemContainer.SubItems.Remove(m_currentTask);
                m_currentTask = null;
                m_viewModel.GetTaskProgress();
                itemPanel1.Refresh();
            }
        }
Example #5
0
        private ucTaskInfo AddButtonItem(DevComponents.DotNetBar.ItemContainer itemContainer, IVX.DataModel.TaskInfoV3_1 info)
        {
            if (itemContainer.SubItems.Contains("buttonItemTask_" + info.TaskId))
            {
                return((ucTaskInfo)itemContainer.SubItems["buttonItemTask_" + info.TaskId]);
            }

            MyLog4Net.Container.Instance.Log.Debug("item.Value.TaskList item id:" + info.TaskId);

            ucTaskInfo buttonItem = new ucTaskInfo();

            buttonItem.Name     = "buttonItemTask_" + info.TaskId;
            buttonItem.Text     = info.TaskName;
            buttonItem.Progress = 0;
            buttonItem.TaskId   = info.TaskId;
            buttonItem.TaskStat = info.Status;
            if (info.Status == IVX.DataModel.E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FINISH)
            {
                buttonItem.Progress = 1000;
            }

            buttonItem.Tooltip  = "[" + info.TaskId + "]" + Environment.NewLine + info.TaskName + "" + Environment.NewLine + info.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
            buttonItem.Checked  = false;
            buttonItem.Click   += new EventHandler(buttonItem_Click);
            buttonItem.DBClick += new EventHandler(buttonItem_DBClick);
            //if (itemContainer.SubItems.Count<100)
            //itemContainer.SubItems.Add(buttonItem);
            //else if (itemContainer.SubItems.Count == 100)
            //{
            //    ucTaskInfo buttonItemt = new ucTaskInfo();
            //    buttonItemt.Name = "buttonItemTask_" + item.Key.ToString();
            //    buttonItemt.Text = "<b>获取更多内容...</b>";

            //    itemContainer.SubItems.Add(buttonItemt);
            //}
            if (ShownTaskList.Find(it => it.TaskId == buttonItem.TaskId) == null)
            {
                ShownTaskList.Add(buttonItem);
            }

            itemContainer.SubItems.Add(buttonItem);
            return(buttonItem);
        }
Example #6
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);
            }
        }
Example #7
0
        void m_viewModel_UpLoadLocalFile(uint arg1, string arg2, string arg3, uint arg4, ulong arg5)
        {
            if (!m_isInited)
            {
                return;
            }

            if (InvokeRequired)
            {
                this.Invoke(new Action <uint, string, string, uint, ulong>(m_viewModel_UpLoadLocalFile), arg1, arg2, arg3, arg4, arg5);
            }
            else
            {
                MyLog4Net.Container.Instance.Log.DebugFormat("axfileupload1.AddTask {0},{1},{2}", arg1, arg2, string.Format("http://{0}:{1}", arg3, arg4));
                uint i = axfileupload1.AddTask(arg1, arg2, string.Format("http://{0}:{1}", arg3, arg4));
                Console.WriteLine(i.ToString());
                ucTaskInfo taskinfo = null;
                try
                {
                    taskinfo = ShownTaskList.Single(item => item.Name == "buttonItemTask_" + arg1);
                }
                catch (Exception)
                {
                    //BuildTaskList();
                    return;
                }

                if (taskinfo != null)
                {
                    taskinfo.Progress = 0;
                    taskinfo.TaskStat = IVX.DataModel.E_VDA_TASK_STATUS.E_TASK_STATUS_IMPORT_EXECUTING;
                    //m_localUploadProgress.Add(taskinfo.TaskId, 0);
                    //new System.Threading.Thread(thStartLocalUpload).Start(taskinfo.TaskId);
                }
            }
        }