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 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 #3
0
        public void Flush()
        {
            ListView.Items.Clear();
            ViewItemDic.Clear();

            foreach (FPSItem fpsItem in FPSItemList)
            {
                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");

                ViewItemDic[fpsItem] = viewItem;
            }
        }