Пример #1
0
        private void TaskRemoved(ObjTask objTask)
        {
            var dashBoardItem = Items.FirstOrDefault(d => d.ObjTask.TaskID == objTask.TaskID);

            if (!dashBoardItem.IsNull())
            {
                pnMenuItem.Controls.Remove(dashBoardItem);
            }
        }
Пример #2
0
        public static ObjTask GetTaskInfo(Guid taskID)
        {
            ObjTask taskInfo = null;

            if (!ObjTasks.IsNull())
            {
                taskInfo = ObjTasks.FirstOrDefault(task => task.TaskID == taskID);
            }
            return(taskInfo);
        }
Пример #3
0
 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();
 }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }