C# TypeInfo IsClass

Description

TypeInfo IsClass Gets a value indicating whether the Type is a class; that is, not a value type or interface.

Syntax

TypeInfo.IsClass has the following syntax.


public bool IsClass { get; }

Example

The following example creates an instance of a type and indicates whether the type is a class.


//from   www . java2 s.  co m
using System;
using System.Reflection;

public   class MyDemoClass
{
}

public class MyTypeClass
{
    public static void Main(string[] args)
    {
       Type  myType = typeof(MyDemoClass);
       Console.WriteLine("\nIs the specified type a class? {0}.", myType.IsClass); 
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo