This is a silly question, but you can use this code to check if something is a particular type...
if (child is IContainer) { //....
Is ther
if (child is IContainer ? false : true)