Tip - Never use type equality because that does not support derived classes:
if (item.GetType() == typeof(Image)) //this is bad, mkay.
Instead use the following which does support derived classes:
if (item is Image)
The Microsoft prefered pattern (when you actually need the cast object) is:
var itemAsType = item as Image;
if (itemAsType != null)
That way, you will only have to typecast once.
Doing that 'computer thing' ever since the C64.
Sometimes I feel that being a programmer is much like being a doctor: You just have to know everything and if you don't, something dies.
Either being an application or a patient.
Oddly enough, more people care about the death of their application, than the massacre of people...