Displaying Various Odds and Ends
Last but not least, you have one final helper method that will simply display various statistics (indi-
cating whether the type is generic, what the base class is, whether the type is sealed, and so forth)
regarding the incoming type:
// Just for good measure.
static void ListVariousStats(Type t)
{
Console.WriteLine("***** Various Statistics *****");
Console.WriteLine("Base class is: {0}", t.BaseType);
Console.WriteLine("Is type abstract? {0}", t.IsAbstract);
Console.WriteLine("Is type sealed? {0}", t.IsSealed);
Console.WriteLine("Is type generic? {0}", t.IsGenericTypeDefinition);
Console.WriteLine("Is type a class type? {0}", t.IsClass);
Console.WriteLine();
}
Do'stlaringiz bilan baham: |