CSharp examples for Microsoft.CodeAnalysis:Roslyn
Is Derived Type Recursive using Roslyn
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis; public class Main{ private static bool IsDerivedTypeRecursive(ITypeSymbol derivedType, ITypeSymbol type) {// www . j a va2s. c om if (derivedType == type) return true; if (derivedType.BaseType == null) return false; return IsDerivedTypeRecursive(derivedType.BaseType, type); } }