private void CalculateIt_Click(object sender, EventArgs e)
        {
            Values.Clear();
            for (int i = 2; i < BoxOfParameters.Controls.Count; i += 2)
            {
                string CheckResult = Graphic_Interface.Analyzer.CheckValidStringDouble
                                         ((BoxOfParameters.Controls[i] as TextBox).Text, 0, 0, true);
                if (CheckResult != "")
                {
                    Values.Add(Convert.ToDouble(CheckResult));
                }
                else
                {
                    Values.Clear();
                    break;
                }
            }

            if (Values.Count > 0)
            {
                ResultTB.Text = F.CalculateValue();
            }
        }
        public void CalculatePayoffsValues()
        {
            CreateNumericalPayoff();
            for (int d = TotalDimensions - 1; d >= 0; d--)
            {
                for (int pl1 = 0; pl1 < N; pl1++)
                {
                    for (int pl2 = 0; pl2 < N; pl2++)
                    {
                        if (pl1 < pl2)
                        {
                            for (int i = 0; i < Strategies[pl1]; i++)
                            {
                                for (int j = 0; j < Strategies[pl2]; j++)
                                {
                                    string s1  = payoffs[d].Array[pl1][pl2][i][j],
                                           s2  = payoffs[d].Array[pl2][pl1][i][j],
                                           CR1 = Graphic_Interface.Analyzer.CheckValidStringDouble(s1, 0, 0, false),
                                           CR2 = Graphic_Interface.Analyzer.CheckValidStringDouble(s2, 0, 0, false);

                                    if (s1 == "")
                                    {
                                        NumericalPayoffs[d][pl1][pl2][i][j] = 0;
                                    }
                                    else
                                    {
                                        if (CR1 != "")
                                        {
                                            NumericalPayoffs[d][pl1][pl2][i][j] = Convert.ToDouble(CR1);
                                        }
                                        else
                                        {
                                            Graphic_Interface.Function F1 = new Graphic_Interface.Function(s1);
                                            List <double> V1 = new List <double>();
                                            V1.Add(cash[pl1]);

                                            for (int k = 0; k < AdParamValues.Count; k++)
                                            {
                                                V1.Add(AdParamValues[k][pl1]);
                                                if ((d < k + 1) && (k < AdParamValues.Count - 1))
                                                {
                                                    V1[V1.Count - 1] += NumericalPayoffs[k + 1][pl1][pl2][i][j];
                                                }
                                            }
                                            F1.GetAllParameterNames(V1);
                                            string R1 = F1.CalculateValue();
                                            NumericalPayoffs[d][pl1][pl2][i][j] = Convert.ToDouble(R1);
                                        }
                                    }
                                    if (s2 == "")
                                    {
                                        NumericalPayoffs[d][pl2][pl1][i][j] = 0;
                                    }
                                    else
                                    {
                                        if (CR2 != "")
                                        {
                                            NumericalPayoffs[d][pl2][pl1][i][j] = Convert.ToDouble(CR2);
                                        }
                                        else
                                        {
                                            Graphic_Interface.Function F2 = new Graphic_Interface.Function(s2);
                                            List <double> V2 = new List <double>();
                                            V2.Add(cash[pl2]);
                                            for (int k = 0; k < AdParamValues.Count; k++)
                                            {
                                                V2.Add(AdParamValues[k][pl2]);
                                                if ((d < k + 1) && (k < AdParamValues.Count - 1))
                                                {
                                                    V2[V2.Count - 1] += NumericalPayoffs[k + 1][pl2][pl1][i][j];
                                                }
                                            }
                                            F2.GetAllParameterNames(V2);
                                            string R2 = F2.CalculateValue();
                                            NumericalPayoffs[d][pl2][pl1][i][j] = Convert.ToDouble(R2);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }