Converting fields dynamically in C#
<p>I have a few functions that convert uint16, uint32, int32 etc to network byte order. Let need to convert the fields for different types of struct dynamically to the network byte order, how could I do that?</p>

<pre><code>eg, structType1, structType2, structType3

void toNetworkByte(what type to pass so that it could accept structType1,2 and 3?)
{
  //getfieldInfo for all the fields in the struct

  //if it is type uint16, call convertUINT16
  // elseif it is type uint32, convertUINT32
  // elseif it is typeof struct, call toNetworkByte again

}
</code></pre>

<p>Thanks.</p>
