如何通过罗斯林找到基类的路径?

发布于 2025-01-27 11:02:54 字数 351 浏览 4 评论 0原文

我试图通过罗斯林找到基类的路径,但找不到任何有用的资源。 有人知道如何解决问题吗?

例如路径:“ ../file1.cs”包含:

using ...;

namespace Extraction
{


 class Class1 : Class2 {
    
    }
}

假设Class2在路径中:“ ../../../file2.cs”,我想分析“ .../file1.cs”文件并查找使用罗斯琳(Roslyn)的基类(class2)路径。是否可以?

编辑:我想实现的目标是合并派生类和父类的所有方法(直至最后一个级别)。我当时想最初找到所有父级的路径(迭代),然后将它们合并为一个类。

I am trying to find the path of the base class via Roslyn but I could not find any helpful resource.
Does anyone have an idea how to approach the problem.

E.g. path: "../File1.cs" contains:

using ...;

namespace Extraction
{


 class Class1 : Class2 {
    
    }
}

Assuming that Class2 is in path: "../../File2.cs", I want to analyze the ".../File1.cs" file and find the base class (Class2) path using Roslyn. Is it possible?

Edit: What I would like to achieve is merging all the methods of the derived class and parent classes (up to the last level) into one class. I was thinking to initially find the paths of all parent classes (iteratively) and afterwards merge them into one class.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文