C# TypeInfo ContainsGenericParameters

Description

TypeInfo ContainsGenericParameters Gets a value indicating whether the current Type object has type parameters that have not been replaced by specific types.

Syntax

TypeInfo.ContainsGenericParameters has the following syntax.


public virtual bool ContainsGenericParameters { get; }

Example


using System;//from   www.ja  v a2s .  c  o  m
using System.Reflection;
using System.Collections.Generic;
public class Base<T, U> { }
public class Derived<V> : Base<int, V> { }

public class Test
{
    public static void Main()
    {
        Type t = typeof(Derived<>);
        Console.WriteLine("\tDoes it have unassigned generic parameters? {0}", 
            t.ContainsGenericParameters);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo