private void TaskRemoved(ObjTask objTask) { var dashBoardItem = Items.FirstOrDefault(d => d.ObjTask.TaskID == objTask.TaskID); if (!dashBoardItem.IsNull()) { pnMenuItem.Controls.Remove(dashBoardItem); } }
public static ObjTask GetTaskInfo(Guid taskID) { ObjTask taskInfo = null; if (!ObjTasks.IsNull()) { taskInfo = ObjTasks.FirstOrDefault(task => task.TaskID == taskID); } return(taskInfo); }
public DashBoardItem(ObjTask objTask) { InitializeComponent(); if (objTask == null) { throw new ArgumentNullException("Value can not be null"); } ObjTask = objTask; lblCaption.Text = ObjTask.TaskName; NORMAL_BACKCOLOR = lblCaption.BackColor; NORMAL_FORGECOLOR = lblCaption.ForeColor; InitEvent(); }
private void TaskAdded(ObjTask objTask) { if (Items.Any(d => objTask.TaskID == d.ObjTask.TaskID)) { throw new Exception("ID already existed in list."); } var dshbItem = new DashBoardItem(objTask) { Dock = DockStyle.Top }; dshbItem.OnRightClicked += OnItemRightClicked; Items.Add(dshbItem); pnMenuItem.Controls.Add(dshbItem); }
public static ObjTask AddTask(string taskName = "") { var task = new ObjTask() { TaskID = Guid.NewGuid() }; if (!string.IsNullOrEmpty(taskName)) { task.Rename(taskName); } ObjTasks.Add(task); TaskAdded(task); return(task); }