Mono Class Library: System.Reflection.MethodInfo Overview | Members

System.Reflection.MethodInfo.ContainsGenericParameters Property

Gets a value that indicates whether a generic method contains unassigned generic type parameters.

public override bool ContainsGenericParameters { get; }

Value

true if the System.Reflection.MethodInfo contains unassigned generic type parameters; otherwise false.

Remarks

In order to invoke a generic method, there must be no generic type definitions or open constructed types in the type arguments of the method itself, or in any enclosing types. If the MethodInfo.ContainsGenericParameters property returns true, the method cannot be invoked.

The MethodInfo.ContainsGenericParameters property searches recursively for type parameters. For example, it returns true for any method in an open type A<T>, even though the method itself is not generic. Contrast this with the behavior of the MethodInfo.IsGenericMethod property, which returns false for such a method.

For a list of the invariant conditions for terms specific to generic methods, see the MethodInfo.IsGenericMethod property. For a list of the invariant conditions for other terms used in generic reflection, see the Type.IsGenericType property.

Operation

This property is read-only.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0