public override bool Equals(object obj) { TaskInfoV3_1 temp = obj as TaskInfoV3_1; if (temp == null) { return(false); } if (temp.StatusList.Count != this.StatusList.Count) { return(false); } foreach (var it in temp.StatusList) { if (!this.StatusList.Exists( xx => xx.AlgthmType == it.AlgthmType && xx.AnalyseParam == it.AnalyseParam && xx.LeftTime == it.LeftTime && xx.Progress == it.Progress && xx.Status == it.Status)) { return(false); } } foreach (var it in this.StatusList) { if (!temp.StatusList.Exists( xx => xx.AlgthmType == it.AlgthmType && xx.AnalyseParam == it.AnalyseParam && xx.LeftTime == it.LeftTime && xx.Progress == it.Progress && xx.Status == it.Status)) { return(false); } } return(temp.TaskId == this.TaskId && temp.CameraID == this.CameraID && temp.ChannelID == this.ChannelID && temp.DeviceIP == this.DeviceIP && temp.DeviceName == this.DeviceName && temp.DevicePort == this.DevicePort && temp.DeviceType == this.DeviceType && temp.EndTime == this.EndTime && temp.FileSize == this.FileSize && temp.FileType == this.FileType && temp.LoginPwd == this.LoginPwd && temp.LoginUser == this.LoginUser && temp.Order == this.Order && temp.OriFilePath == this.OriFilePath && temp.Priority == this.Priority && temp.ProtocolType == this.ProtocolType && temp.StartTime == this.StartTime && temp.StoreIP == this.StoreIP && temp.TaskName == this.TaskName && temp.StorePort == this.StorePort && temp.TaskType == this.TaskType && temp.UserHandle == this.UserHandle); }
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); }