private void CheckCorrectness() { switch (NowRandomComponent.ToString()) { case "Матрицы": { switch (NowRandomMatrixFunction.ToString()) { case "Sub": { DataGridView CheckDataGrid = new DataGridView(); CheckDataGrid.RowCount = dataGridViews[0].RowCount; CheckDataGrid.ColumnCount = dataGridViews[0].ColumnCount; CheckDataGrid = MatrixCalculator.MatrixSub(dataGridViews[0], dataGridViews[1], CheckDataGrid); if (CheckIdentityMatrix(CheckDataGrid, dataGridViews[2])) { CorrectCount++; } break; } case "Mul": { DataGridView CheckDataGrid = new DataGridView(); CheckDataGrid.RowCount = dataGridViews[0].RowCount; CheckDataGrid.ColumnCount = dataGridViews[0].ColumnCount; CheckDataGrid = MatrixCalculator.MatrixMul(dataGridViews[0], dataGridViews[1], CheckDataGrid); if (CheckIdentityMatrix(CheckDataGrid, dataGridViews[2])) { CorrectCount++; } break; } } break; } case "Уравнения": { if (EquChecker != 4) { if (AnswerText.Text == NewtonCalculations.GetRoot(NewtonCalculations.f, NewtonCalculations.fdX, FirstB, SecondB, koef1).ToString()) { CorrectCount++; } } else { } break; } } }
private Label CreateQuestionLabel(string function) { Label QuestionLabel = new Label(); QuestionLabel.Location = new Point(50, 50); QuestionLabel.Font = new Font("Microsoft Sans Serif", 20); QuestionLabel.Text = "Вопрос номер " + QuestionCounter.ToString() + " : " + NowRandomComponent.ToString() + ", " + function; QuestionLabel.Size = new Size(1100, 150); QuestionLabel.ForeColor = Color.Blue; return(QuestionLabel); }