title: Method to pass 3 different data types to do the same thing?
body: <p>I think the title might be wrong.. haha unsure.. anyway..</p>
  
  <p>I have 3 different data types..</p>
  
  <pre><code>public class data1
  {
      public Color color;
      public int len;
      public DrawingVisual dv;
      Other vars...
  }
  public class data2
  {
      public Color color;
      public int len;
      public DrawingVisual dv;
      Other vars different from data1 vars...
  }
  </code></pre>
  
  <p>Etc...</p>
  
  <p>How can I create a function to pass these in and then get the vars I need inside the function..
  Example..</p>
  
  <pre><code>void Something(var data)
  {
      switch (typeof(data))
      {
           case data1:
  
           break;
           case data1:
  
           break;
      }
  }
  </code></pre>
  
  <p>This wont work obviously.. but its just an example..</p>
  
  <p>How can I actually do this?</p>
  
  <p>Thanks</p>