title: Trying to send a file to another class in C#
body: <p>as the title suggests im trying to send a file acquired by stream reader to another class so that that class can extract the information from it. I have tried extracting it within the form but this makes it confusing and im certain is a poor way of doing it. Can anyone suggest a way?</p>
  
  <p>Here is the class that identifies the file..</p>
  
  <pre><code>namespace DistanceEstimatorFinal
  {
      public partial class Form1 : Form
  
  
          private void openDataListToolStripMenuItem_Click(object sender, EventArgs e)
          {
              OpenFileDialog ofd = new OpenFileDialog();
              ofd.Filter = "CSV files (*.csv)|*.csv|Text files ( *.txt)|*.txt |All files (*.*)|*.*";
              if (ofd.ShowDialog(this).Equals(DialogResult.OK))
              {
                  Stream fileStream = ofd.OpenFile();
  
                  using (StreamReader reader = new StreamReader(fileStream))
                  {
  
                  }
              }
          } 
  </code></pre>
  
  <p>Now I need some way of sending it here... I can't see how :[</p>
  
  <pre><code>namespace DistanceEstimatorFinal
  {
  
      public class dataPoints
      {
          List&lt;dataPoint&gt; Points;
          public dataPoints( )
          {
              Points = new List&lt;dataPoint&gt;();
              TextReader tr = new StreamReader();
              string input;
              while ((input = tr.ReadLine()) != null)
              {
                  string[] bits = input.Split(',');
                  dataPoint a = new dataPoint(bits[0],bits[1],bits[2]);              
                  Points.Add(a);  
  
  
              }
  
              tr.Close();
          }
  
          internal dataPoint getItem(int p)
          {
              if (p &lt; Points.Count)
              {
                  return Points[p];
              }
              else
                  return null;
          }
      }
  
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated</p>