public static bool CheckElementsAreOfType( IEnumerable e, Type t) { foreach (object o in e) { if (!t.IsInstanceOfType(o)) return false; } return true; }