|
|
|
@ -32,6 +32,7 @@ using ICSharpCode.Decompiler.Ast.Transforms;
@@ -32,6 +32,7 @@ using ICSharpCode.Decompiler.Ast.Transforms;
|
|
|
|
|
using ICSharpCode.ILSpy.XmlDoc; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem.Implementation; |
|
|
|
|
using CSharp = ICSharpCode.NRefactory.CSharp; |
|
|
|
|
using ICSharpCode.NRefactory.VB; |
|
|
|
|
using ICSharpCode.NRefactory.VB.Visitors; |
|
|
|
|
using Mono.Cecil; |
|
|
|
@ -439,8 +440,16 @@ namespace ICSharpCode.ILSpy.VB
@@ -439,8 +440,16 @@ namespace ICSharpCode.ILSpy.VB
|
|
|
|
|
void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module) |
|
|
|
|
{ |
|
|
|
|
astBuilder.RunTransformations(transformAbortCondition); |
|
|
|
|
if (options.DecompilerSettings.ShowXmlDocumentation) |
|
|
|
|
AddXmlDocTransform.Run(astBuilder.SyntaxTree); |
|
|
|
|
if (options.DecompilerSettings.ShowXmlDocumentation) { |
|
|
|
|
try { |
|
|
|
|
AddXmlDocTransform.Run(astBuilder.SyntaxTree); |
|
|
|
|
} catch (XmlException ex) { |
|
|
|
|
string[] msg = (" Exception while reading XmlDoc: " + ex.ToString()).Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); |
|
|
|
|
var insertionPoint = astBuilder.SyntaxTree.FirstChild; |
|
|
|
|
for (int i = 0; i < msg.Length; i++) |
|
|
|
|
astBuilder.SyntaxTree.InsertChildBefore(insertionPoint, new CSharp.Comment(msg[i], CSharp.CommentType.Documentation), CSharp.Roles.Comment); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var csharpUnit = astBuilder.SyntaxTree; |
|
|
|
|
csharpUnit.AcceptVisitor(new NRefactory.CSharp.InsertParenthesesVisitor() { InsertParenthesesForReadability = true }); |
|
|
|
|
var unit = csharpUnit.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider()), null); |
|
|
|
|