Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOne_Click(object sender, EventArgs e)
 {
     BaseClass bc = new BaseClass();
     List<string> splitArray = new List<string>();
     if (bc.CheckNumbers(textBox1.Text, out splitArray) == false)
     {
         lblErrorOutput.Text = bc.ErrorString;
         return;
     }
     List<int> mylist = splitArray.Select(n => int.Parse(n)).ToList();
     Sum sum = bc.RetrieveIndexOfTopSum(mylist);
     lblMethodOneTime.Text = bc.RunTime();
     lblMethodOneAnswer.Text = sum.minValue.ToString();
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOne_Click(object sender, EventArgs e)
        {
            BaseClass     bc         = new BaseClass();
            List <string> splitArray = new List <string>();

            if (bc.CheckNumbers(textBox1.Text, out splitArray) == false)
            {
                lblErrorOutput.Text = bc.ErrorString;
                return;
            }
            List <int> mylist = splitArray.Select(n => int.Parse(n)).ToList();
            Sum        sum    = bc.RetrieveIndexOfTopSum(mylist);

            lblMethodOneTime.Text   = bc.RunTime();
            lblMethodOneAnswer.Text = sum.minValue.ToString();
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnTwo_Click(object sender, EventArgs e)
 {
     try
     {
         BaseClass     bc         = new BaseClass();
         List <string> splitArray = new List <string>();
         if (bc.CheckNumbers(textBox1.Text, out splitArray) == false)
         {
             lblErrorOutput.Text = bc.ErrorString;
             return;
         }
         List <int> mylist = splitArray.Select(n => int.Parse(n)).ToList();
         Sum        sum    = new Sum(int.MinValue, int.MinValue);
         bc.RetrieveIndexOfTopSum(mylist, out sum);
         lblMethodTwoTime.Text   = bc.RunTime();
         lblMethodTwoAnswer.Text = sum.minValue.ToString();
     }
     catch (ApplicationError err)
     {
         lblErrorOutput.Text = err.Message;
     }
 }
Пример #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnTwo_Click(object sender, EventArgs e)
 {
     try
     {
         BaseClass bc = new BaseClass();
         List<string> splitArray = new List<string>();
         if (bc.CheckNumbers(textBox1.Text, out splitArray) == false)
         {
             lblErrorOutput.Text = bc.ErrorString;
             return;
         }
         List<int> mylist = splitArray.Select(n => int.Parse(n)).ToList();
         Sum sum = new Sum(int.MinValue, int.MinValue);
         bc.RetrieveIndexOfTopSum(mylist, out sum);
         lblMethodTwoTime.Text = bc.RunTime();
         lblMethodTwoAnswer.Text = sum.minValue.ToString();
     }
     catch (ApplicationError err)
     {
         lblErrorOutput.Text = err.Message;
     }
 }