You can call it by reflection:
MethodInfo method = typeof(Queryable).GetMethod("OfType");
MethodInfo generic = method.MakeGenericMethod(new Type[]{ type });
// Use .NET 4 covariance
var result = (IEnumerable<object>) generic.Invoke
(null, new object[] { context.Resources });
object[] array = result.ToArray();
An alternative would be to write your own OfTypeAndToArray
generic method to do both bits of it, but the above should work.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…