C# How do I convert a string into an instance of a class?
<p>In my program I have a Class Tracer:</p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace Tracepak_Heat_Loss_Program
    {
        class Tracer
        {
            public string family;
            public string model;
            public string type;
            public int output;
            public int voltage;
            public int maxMaintain;
            public int maxIntermittent;
            public string tRating;
            public string approvals;
            public string code;

            public Tracer(string f, string m, string t, int o, int v, int mM, int mI,string tR, string a, string c) 
            {            
                family = f;
                model = m;
                type = t;
                output = o;
                voltage = v;
                maxMaintain = mM;
                maxIntermittent = mI;
                tRating = tR;
                approvals = a;
                code = c;
            }
        }    
    }
</code></pre>

<p>In my main form i have created instances of several tracers:</p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;


    namespace Tracepak_Heat_Loss_Program
    {
        public partial class mainForm : Form
        {
            public mainForm()
            {
                InitializeComponent();
            }

            private void mainForm_Load(object sender, EventArgs e)
            {
            }


            Tracer J3 = new Tracer("Raychem BTV", "3BTV1-CT", "Self-Reg", 3, 120, 150, 185, "T6", "FM/CSA/ATEX", "J3");
            Tracer J5 = new Tracer("Raychem BTV", "5BTV1-CT", "Self-Reg", 5, 120, 150, 185, "T6", "FM/CSA/ATEX", "J5");
            Tracer J8 = new Tracer("Raychem BTV", "8BTV1-CT", "Self-Reg", 8, 120, 150, 185, "T6", "FM/CSA/ATEX", "J8");
            Tracer J10 = new Tracer("Raychem BTV", "10BTV1-CT", "Self-Reg", 10, 120, 150, 185, "T6", "FM/CSA/ATEX", "J10");
</code></pre>

<p>I have a method in my main form that returns the tracer name from a listbox</p>

<pre><code>    public string GetTracer()
    {
        String s = tracerListBox.Text;
        int index = s.IndexOf(" ");
        return index &gt;= 0 ? s.Substring(0, index): s;
    }
    // This could yield "J3" for example
</code></pre>

<p>I want to be able to use the results of GetTracer() to retrieve properties of that tracer. </p>

<p>For Example:</p>

<p>I could call</p>

<pre><code>    J3.family;

    // The result of which is "Raychem BTV"
</code></pre>

<p>What I want to do is use</p>

<pre><code>    GetTracer().family;
</code></pre>

<p>and have it return the property associated with the tracer that my method GetTracer returns.</p>

<p>Is this possible? Thank you in advance for your assistance.  I am very new to programming and, while I am trying to make my code more robust by using classes, it is proving to be more difficult than I imagined.</p>
