Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# tell if a class is a child or the class itself

void Main()
{
    typeof(Derived).IsSubclassOf(typeof(Base)).Dump();
    typeof(Base).IsSubclassOf(typeof(Base)).Dump();
}

public class Base { }
public class Derived : Base { }
 
PREVIOUS NEXT
Tagged: #class #child #class
ADD COMMENT
Topic
Name
6+7 =