I have an array of different type objects and I use a BinaryWriter to convert each item to its binary equivalent so I can send the structure over the network.
I curr
What you're asking for is Dynamic Dispatch, and C# 3.0 doesn't have it.
You should at least use a runtime check to verify that you aren't missing a type.
You may be able to do something clever where you have a Dictionary
that maps from types to processing functions. You can fill in the mapping for all processing functions in one place. You have a better chance of getting this right than if you write a switch wherever the processing happens.