Example #1
0
        public ObjectiveList(string fileName, EditObjectivePanel_Delegate ed)
        {
            AutoScroll  = true;
            RowCount    = 0;
            Dock        = DockStyle.Fill;
            ColumnCount = 3;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 10f));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80f));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 10f));

            _savePoint        = fileName;
            _filterType       = Objective.ObjectiveType.ALL;
            _sortType         = SortType.DEFAULT;
            _aToz             = true;
            _prioritySortType = Objective.Priority.ALL;

            _objectives = FileManager.DeserializeData(_savePoint).Select(d => new ObjectiveViewPanel(d, ed, () => DeleteObjective(d))).ToList();
            _objectives.RemoveAll(p => !p.Displayed.Persist && p.Displayed.DueBy < DateTime.Now);
            _objectives.ForEach(o => {
                if (o.Displayed.Repeat)
                {
                    while (o.Displayed.DueBy < DateTime.Now)
                    {
                        o.Displayed.DueBy += TimeSpan.FromDays(1);
                    }
                }
            });

            _editDelegate = ed;
            UpdateShownObjectives();
        }
Example #2
0
        public static string ConvertPriority(Objective.Priority priority)
        {
            switch (priority)
            {
            case Objective.Priority.NONE:
                return("None");

            case Objective.Priority.LOW:
                return("Low");

            case Objective.Priority.MEDIUM:
                return("Medium");

            case Objective.Priority.HIGH:
                return("High");

            case Objective.Priority.CRITICAL:
                return("Critical");

            case Objective.Priority.ALL:
            default:
                return("???");
            }
        }
Example #3
0
 public void SetPriorityTo(Objective.Priority type)
 {
     _prioritySortType = type;
     UpdateShownObjectives();
 }