Open and constructed generic types : Type : Reflection C# Examples


C# Examples » Reflection » Type »

 

Open and constructed generic types









    
using  System;
using  System.Collections.Generic;
using  System.Text;
using  System.Threading;
using  System.Reflection;
using  System.Reflection.Emit;

public  class  MainClass
{
        public  static  void  Main()
        {
                Type  listType  =  typeof(List<>);
                Console.WriteLine("List<>:  {0},  {1}",listType.IsGenericType,  listType.ContainsGenericParameters);
                Type  listIntType  =  typeof(List<int>);
                Console.WriteLine("List<int>:  {0},  {1}",listIntType.IsGenericType,  listIntType.ContainsGenericParameters);
        }
}
    
   
  
   



Output

List: True, True
List: True, False


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Reflection
» Type