private void BuildNextRandom() { NowRandomComponent = (Component)random.Next(0, 2); switch (NowRandomComponent.ToString()) { case "Матрицы": { NowRandomMatrixFunction = (MatrixFunctions)random.Next(0, 2); switch (NowRandomMatrixFunction.ToString()) { case "Sub": { dataGridViews = new DataGridView[3]; dataGridViews = MatrixBuilder.BuildDefaultThreeMatrix(random.Next(1, 6), random.Next(1, 6), dataGridViews); QuestionLabel = CreateQuestionLabel("Вычитение"); Controls.Add(QuestionLabel); PrevRandomComponent = 0; InitialyzeComponents(dataGridViews); break; } case "Mul": { dataGridViews = new DataGridView[3]; int Count = random.Next(1, 6); dataGridViews = MatrixBuilder.BuildDefaultThreeMatrix(Count, Count, dataGridViews); QuestionLabel = CreateQuestionLabel("Умножение"); Controls.Add(QuestionLabel); PrevRandomComponent = 0; InitialyzeComponents(dataGridViews); break; } } break; } case "Уравнения": { NowEquFunction = random.Next(0, 0); FirstB = random.Next(-10, 0); SecondB = random.Next(0, 11); switch (NowEquFunction) { case 0: { koef1 = random.Next(-1, 10); AnswerText = CreateTextBox(); Controls.Add(AnswerText); QuestionLabel = CreateQuestionLabel("Cos(x-" + koef1 + "). Границы: " + FirstB + ", " + SecondB); Controls.Add(QuestionLabel); PrevRandomComponent = (Component)1; break; } //case 2: // { // } //case 3: // { // } //case 4: // { // } } break; } } QuestionCounter++; }