private void nextPairButton_Click(object sender, EventArgs e)
 {
     if (level == -1)
     {
         applyRatio(g_AHP, pairIndexesMajor);
     }
     else
     {
         applyRatio(AHPs.ElementAt(level), pairIndexesMinor);
     }
 }
        private void endAddingButton_Click(object sender, EventArgs e)
        {
            if (level == 0)
            {
                if (criterionPool.Count < 3)
                {
                    MessageBox.Show("Three or more criteria are required.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                addNamesBox.Text = "Add categories";
                level++;
                g_AHP = new Form1(criterionPool.ToArray());
                criterionPool.Clear();
                return;
            }
            level = -1;
            if (criterionPool.Count < 2)
            {
                MessageBox.Show("Two or more categories are required.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string [] criterionNames = criterionPool.ToArray();
            for (int i = 0; i < g_AHP.Amount; i++)
            {
                AHPs.Add(new Form1(criterionNames));
            }

            addNamesBox.Enabled      = false;
            prioritiesAddBox.Enabled = true;
            criterionPool.Clear();
            criterionTextBox.Clear();

            pairIndexesMajor = generatePairs(g_AHP.Amount);
            pairIndexesMinor = generatePairs(AHPs.ElementAt(0).Amount);

            setRadioButtons(g_AHP.Names, pairIndexesMajor);
        }
 private void applyRatio(Form1 aHP, List <int[]> pairIndexes)
 {
     if (valuesComboBox.SelectedIndex != -1)
     {
         if (choice1.Checked)
         {
             aHP.setPriority(pairIndexes.ElementAt(index)[0], pairIndexes.ElementAt(index)[1], Int32.Parse(valuesComboBox.Text));
         }
         else
         {
             aHP.setPriority(pairIndexes.ElementAt(index)[1], pairIndexes.ElementAt(index)[0], Int32.Parse(valuesComboBox.Text));
         }
         index++;
         if (index < pairIndexes.Count)
         {
             setRadioButtons(aHP.Names, pairIndexes);
         }
         else
         {
             if (level < AHPs.Count - 1)
             {
                 aHP.calculateVectors();
                 aHP.PRINTFORILLYA();
                 level++;
                 index = 0;
                 setRadioButtons(AHPs.ElementAt(level).Names, pairIndexes);
                 prioritiesAddBox.Text = g_AHP.Names[level];
             }
             else
             {
                 aHP.calculateVectors();
                 aHP.PRINTFORILLYA();
                 prioritiesAddBox.Enabled = false;
                 showResultDialogBox();
             }
         }
     }
 }