需要选择选择声明样式

时间:2013-08-08 17:43:03

标签: c# ilspy

有人可以帮忙解决这个问题吗?

============

当我们从程序集(示例)反编译代码时:

        AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(fileName);
        AstBuilder decompiler = new AstBuilder(new DecompilerContext(assembly.MainModule));
        decompiler.AddAssembly(assembly);
        StringWriter output = new StringWriter();
        decompiler.GenerateCode(new PlainTextOutput(output));

我们得到的代码格式是所有“using”语句都在文件顶部,并且这些类被正确放置。

这对我来说是个问题。我需要知道反编译后类/结构/枚举等的完整命名空间路径。那么,不是将所有命名空间都放在“using”块中,是否有为每个对象编写完整类路径的选项?

所需输出的示例:

class TestApp {
    public class System { }
    const int Console = 7;
    const int number = 66;
    static void Main() {
        global::System.Console.WriteLine(number);
    }
}

============

链接到我在ILSpy论坛上的帖子

http://community.sharpdevelop.net/forums/t/19302.aspx

1 个答案:

答案 0 :(得分:0)

ILSpy社区承认,截至今天,此功能尚未出现。

当前版本意味着 - ILSpy 2.0(ILSpy_Master_2.1.0.1603_RTW_Binaries.zip)

相关问题