static void Create(Hashtable l) { l.Clear(); int num = AskNum("Введите количество элементов"); Verification.Verification cur; for (int i = 0; i < num; i++) { switch (rand.Next(0, 2)) { case 1: cur = new Test(); break; case 2: cur = new Exam(); break; default: cur = new FinalExam(); break; } l.Add(cur.ToString(), cur); } }
static void Add(Hashtable l) { Verification.Verification cur; switch (rand.Next(1, 4)) { case 1: cur = new Test(); break; case 2: cur = new Exam(); break; default: cur = new FinalExam(); break; } l.Add(cur.ToString(), cur); }