private void btnParse_Click(object sender, EventArgs e)
        {
            try
            {
                pv1.Model.InvalidatePlot(true);

                string input = tbInput.Text.Trim(' ');
                b.RootFunc    = b.Insert(ref input);
                tbResult.Text = b.ParseToString(b.RootFunc);
                pv1.Model.Series.Add(b.GetFunctionSerieMainFunction());
            }
            catch (UnAcceptedDegreeForPowerException u)
            {
                MessageBox.Show(u.Message);
            }
            catch (UnacceptedFunctionForFactorialException u)
            {
                MessageBox.Show(u.Message);
            }
            catch (FormatException)
            {
                MessageBox.Show("Please input the correct format!");
            }
        }
 private void btnParse_Click(object sender, EventArgs e)
 {
     try
     {
         string input = tbInput.Text.Trim(' ');
         b.RootFunc = b.Insert(ref input);
         if (rbMainFunction.Checked)
         {
             tbResult.Text = b.ParseToString(b.RootFunc.SimplifyFunction());
         }
         else if (rbDerAnalytically.Checked)
         {
             tbResult.Text = b.ParseToString(b.RootFunc.GetDerivativeAnalytically().SimplifyFunction());
         }
     }
     catch (UnAcceptedDegreeForPowerException u)
     {
         MessageBox.Show(u.Message);
     }
     catch (UnacceptedFunctionForFactorialException u)
     {
         MessageBox.Show(u.Message);
     }
     catch (Denominator0Exception d)
     {
         MessageBox.Show(d.Message);
     }
     catch (IndexOutOfRangeException)
     {
         MessageBox.Show("Please input the correct format!");
     }
     catch (FormatException)
     {
         MessageBox.Show("Please input the correct format!");
     }
 }