Example #1
0
 private void OpenProfile()
 {
     OpenFileDialog ofd = new OpenFileDialog();
     if(ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         double[] x;
         double[] up;
         double[] low;
         using (StreamReader sr = new StreamReader(ofd.FileName))
         {
             int number = 0;
             string sData = sr.ReadLine();
             if (int.TryParse(sData, out number))
             {
                 x = new double[number];
                 up = new double[number];
                 low = new double[number];
                 for (int i = 0; i < number; i++)
                 {
                     sData = sr.ReadLine();
                     string[] d = sData.Split(';');
                     if(!double.TryParse(d[0], out x[i]))
                     {
                         return;
                     }
                     if(!double.TryParse(d[1], out up[i]))
                     {
                         return;
                     }
                     if(!double.TryParse(d[2], out low[i]))
                     {
                         return;
                     }
                 }
             }
             else { return; }
         }
         TProfile tp = new TProfile(x, up, low);
         tp.MdiParent = this;
         tp.Show();
     }
 }
Example #2
0
 private void NewProfile()
 {
     TProfile tp = new TProfile();
     tp.MdiParent = this;
     tp.Show();
 }