Type properties

You can use System.Type object to access the type's name, assembly, base type, visibility, and so on.

For example:


using System;
using System.Reflection;
using System.Collections.Generic;

class MainClass
{
    static void Main()
    {
        Type stringType = typeof(String);
        string name = stringType.Name;  // String
        Type baseType = stringType.BaseType;  // typeof(Object) 
        Assembly assem  = stringType.Assembly;  // mscorlib.dll 
        bool isPublic = stringType.IsPublic;  // true

    }

}
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.