title: Array List without knowing the type until run time
body: <p>I have the following Scenario:</p>
  
  <p>I have an Array List that could contain one of three possible object types that I only have access to at run time.</p>
  
  <p>Fort this example lets call them:</p>
  
  <pre><code>ObjType1
  ObjType2
  ObjType3
  </code></pre>
  
  <p>I need to then loop through the array list and access several properties from each object (All three objects types contain the same two property names) and then set these values to properties on one of three other object types. Finally the new objects then need to be added to an array List. </p>
  
  <pre><code>ObjType4
  ObjType5
  ObjType6
  </code></pre>
  
  <p>As I don't know what object type the array list contains in advance I am guessing that I need to use reflection to get the objects properties. Once I have the properties I could add them to a generic class that contains the same two properties as ObjType 4,5 and 6 and then cast the generic class object to the desired object type passed in to the sub procedure/function and then add it to the array list.</p>
  
  <p>what would be the best way to achieve this in your opinion? </p>
  
  <p>Thanks for everyones Time</p>
  
  <p>Edit - I should have mentioned before that I do not have access to change the three classes.</p>