3
comment savoir si un type a hérité d'un autre type?comment savoir si un type a hérité d'un autre type?
Type t;
// i get the t from somewhere
bool b = t.IsInhertitedFrom(typeof(BaseType));
comment savoir si un type a hérité d'un autre type?comment savoir si un type a hérité d'un autre type?
Type t;
// i get the t from somewhere
bool b = t.IsInhertitedFrom(typeof(BaseType));
bool b = t.IsSubclassOf (typeof (BaseType))
et pour vérifier si le type met en oeuvre l'utilisation de l'interface:
bool b = t.GetInterface (typeof (IMyInterface) .FullName) ! = null