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
While the IS operator is normally the best way, there is an alternative that you can use in some cirumstances. You can use the as operator and test for null.
MyClass mc = foo as MyClass; if ( mc == null ) { } else {}