private void BtnNext_Click(object sender, EventArgs e) { if (_isTest) { countPassedQuestion++; if (result.Text == correctAnswer) { countCorrectAnswer++; } if (maxCount > countPassedQuestion) { FormDDCTest1 form = new FormDDCTest1(true, _codec); form.Show(); this.Close(); } else { int mark = countCorrectAnswer * 5 / countPassedQuestion; ResultForm form = new ResultForm(mark, this.Text, countCorrectAnswer, countPassedQuestion); form.Show(); countPassedQuestion = 0; countCorrectAnswer = 0; this.Close(); } } else { FormDDCTest1 form = new FormDDCTest1(false, _codec); form.Show(); this.Close(); } }
private void OpenForm(string formName, bool isTest, bool codec = true) { if (formName.Equals("Код Элайеса")) { if (codec) { SystematicCode.ElaesaCode.FormElaesaTest1 form = new SystematicCode.ElaesaCode.FormElaesaTest1(isTest); form.Show(); } else { SystematicCode.ElaesaCode.FormElaesaTest5 form = new SystematicCode.ElaesaCode.FormElaesaTest5(isTest); form.Show(); } } else if (formName.Equals("Код Варшамова")) { if (codec) { SystematicCode.VarshamovaCode.FormVarshamovaTest1 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest1(isTest); form.Show(); } else { SystematicCode.VarshamovaCode.FormVarshamovaTest2 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды Рида-Милеера")) { if (codec) { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1(isTest); form.Show(); } else { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2(isTest); form.Show(); } } else if (formName.Equals("Код Хеминга 1")) { SystematicCode.HemingaCode.FormHemingaTest1 form = new SystematicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } // cyclic codes else if (formName.Equals("Коды Абрамсона")) { CyclicCode.AbramsonaCode.FormAbramsTest1 form = new CyclicCode.AbramsonaCode.FormAbramsTest1(isTest, codec); form.Show(); } else if (formName.Equals("Коды Файра")) { FormFairaTest1 form = new FormFairaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Хеминга 2")) { CyclicCode.HemingaCode.FormHemingaTest1 form = new CyclicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код БЧХ")) { CyclicCode.BChHCode.FormBChHTest1 form = new CyclicCode.BChHCode.FormBChHTest1(isTest, codec); form.Show(); } //non binary codes else if (formName.Equals("Первичные недвоичные коды")) { if (codec) { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1(isTest); form.Show(); } else { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2(isTest); form.Show(); } } else if (formName.Equals("Код с проверкой по модулю q")) { if (codec) { Non_binaryCode.CodeWithModuleTest.FormModuleTest1 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest1(isTest); form.Show(); } else { Non_binaryCode.CodeWithModuleTest.FormModuleTest6 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest6(isTest); form.Show(); } } else if (formName.Equals("Код с простым повторением")) { Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1 form = new Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1(isTest, codec); form.Show(); } else if (formName.Equals("Итеративный код")) { if (codec) { Non_binaryCode.IterativityCode.FormIterativityTest1 form = new Non_binaryCode.IterativityCode.FormIterativityTest1(isTest); form.Show(); } else { Non_binaryCode.IterativityCode.FormIterativityTest5 form = new Non_binaryCode.IterativityCode.FormIterativityTest5(isTest); form.Show(); } } //other codes else if (formName.Equals("Код Грея")) { ElseCodeAndLabs.GrayCode.FormGrayTest1 form = new ElseCodeAndLabs.GrayCode.FormGrayTest1(isTest, codec); form.Show(); } else if (formName.Equals("Двоично-десятичный код")) { FormDDCTest1 form = new FormDDCTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Бергера")) { ElseCodeAndLabs.BergerCode.FormBergerTest1 form = new ElseCodeAndLabs.BergerCode.FormBergerTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Шенона-Фано")) { ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1 form = new ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1(isTest); form.Show(); } else if (formName.Equals("Код Хаффмена")) { if (codec) { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1(isTest); form.Show(); } else { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды-спутники")) { if (codec) { ElseCodeAndLabs.SateliteCode.FormSateliteTest1 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest1(isTest); form.Show(); } else { ElseCodeAndLabs.SateliteCode.FormSateliteTest4 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest4(isTest); form.Show(); } } else if (formName.Equals("Количество информации и энтропия")) { ElseCodeAndLabs.Entropy.FormEntropyTest1 form = new ElseCodeAndLabs.Entropy.FormEntropyTest1(); form.Show(); } else if (formName.Equals("Рекурентный код")) { if (codec) { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1(isTest); form.Show(); } else { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4(isTest); form.Show(); } } else if (formName.Equals("Канальные коды")) { } }