在NFactory解析树上,如果当前类实际上继承(或不继承)另一个类,最好的方法是什么?
发布于 2013-04-29 02:08:55
您应该看看解析后的树是否有任何基类型。
TypeDeclaration typeDeclaration = new CSharpParser().Parse("public class A:B{}").Children.OfType<TypeDeclaration>().First();
if(typeDeclaration.ClassType==ClassType.Class && typeDeclaration.BaseTypes.Count>=1)
{
//this class is inherited..
}https://stackoverflow.com/questions/16180640
复制相似问题