Exemple #1
0
        public void Remove(FPSItem fpsItem)
        {
            CloseProblemForm(fpsItem);
            CloseEditForm(fpsItem);

            ListView.Items.Remove(ViewItemDic[fpsItem]);
            ViewItemDic.Remove(fpsItem);
            ProblemFormDic.Remove(fpsItem);
            EditFormDic.Remove(fpsItem);

            FPSItemList.Remove(fpsItem);

            GC.Collect();
        }
Exemple #2
0
        public void Add(FPSItem fpsItem)
        {
            ListViewItem viewItem = ListView.Items.Add(fpsItem.Title);

            viewItem.SubItems.Add(fpsItem.TimeLimit + fpsItem.TimeLimitUnit);
            viewItem.SubItems.Add(fpsItem.MemoryLimit + fpsItem.MemoryLimitUnit);

            int casesCount = fpsItem.TestOutput.Length;

            if (!string.IsNullOrEmpty(fpsItem.SampleOutput))
            {
                casesCount++;
            }
            viewItem.SubItems.Add(casesCount.ToString());
            viewItem.SubItems.Add((Math.Max(fpsItem.TestDataSize / 1024, 1)).ToString() + "KB");

            FPSItemList.Add(fpsItem);
            ViewItemDic[fpsItem] = viewItem;
        }
Exemple #3
0
        public void Clear()
        {
            foreach (FPSItem key in ProblemFormDic.Keys)
            {
                CloseProblemForm(key);
            }

            foreach (FPSItem key in EditFormDic.Keys)
            {
                CloseEditForm(key);
            }

            ListView.Items.Clear();
            ProblemFormDic.Clear();
            ViewItemDic.Clear();
            FPSItemList.Clear();
            EditFormDic.Clear();

            GC.Collect();
        }
Exemple #4
0
 public void Sort <T>(Func <FPSItem, T> selector)
 {
     FPSItemList = FPSItemList.OrderBy(selector).ToList();
     Flush();
 }