コード例 #1
0
        void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module)
        {
            astBuilder.RunTransformations(transformAbortCondition);
            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);
            var outputFormatter  = new VBTextOutputFormatter(output);
            var formattingPolicy = new VBFormattingOptions();

            unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
        }
コード例 #2
0
ファイル: VBLanguage.cs プロジェクト: shalang/ILSpy
        void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module)
        {
            astBuilder.RunTransformations(transformAbortCondition);
            if (options.DecompilerSettings.ShowXmlDocumentation)
            {
                AddXmlDocTransform.Run(astBuilder.CompilationUnit);
            }
            var unit             = astBuilder.CompilationUnit.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider(CreateResolveContext(module))), null);
            var outputFormatter  = new VBTextOutputFormatter(output);
            var formattingPolicy = new VBFormattingOptions();

            unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
        }
コード例 #3
0
        void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module)
        {
            astBuilder.RunTransformations(transformAbortCondition);
            //if (options.DecompilerSettings.ShowXmlDocumentation)
            //	AddXmlDocTransform.Run(astBuilder.CompilationUnit);
            var csharpUnit = astBuilder.SyntaxTree;

            csharpUnit.AcceptVisitor(new NRefactory.CSharp.InsertParenthesesVisitor()
            {
                InsertParenthesesForReadability = true
            });
            var unit             = csharpUnit.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider()), null);
            var outputFormatter  = new VBTextOutputFormatter(output);
            var formattingPolicy = new VBFormattingOptions();

            unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
        }
コード例 #4
0
ファイル: VBLanguage.cs プロジェクト: Netring/ILSpy
		void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module)
		{
			astBuilder.RunTransformations(transformAbortCondition);
			if (options.DecompilerSettings.ShowXmlDocumentation)
				AddXmlDocTransform.Run(astBuilder.CompilationUnit);
			var unit = astBuilder.CompilationUnit.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider()), null);
			var outputFormatter = new VBTextOutputFormatter(output);
			var formattingPolicy = new VBFormattingOptions();
			unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
		}
コード例 #5
0
ファイル: VBLanguage.cs プロジェクト: rongchunzhang/ILSpy
		void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module)
		{
			astBuilder.RunTransformations(transformAbortCondition);
			if (options.DecompilerSettings.ShowXmlDocumentation)
				AddXmlDocTransform.Run(astBuilder.SyntaxTree);
			var csharpUnit = astBuilder.SyntaxTree;
			csharpUnit.AcceptVisitor(new NRefactory.CSharp.InsertParenthesesVisitor() { InsertParenthesesForReadability = true });
			var unit = csharpUnit.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider()), null);
			var outputFormatter = new VBTextOutputFormatter(output);
			var formattingPolicy = new VBFormattingOptions();
			unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
		}
コード例 #6
0
ファイル: VBLanguage.cs プロジェクト: nakijun/dnSpy
		void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDef module)
		{
			astBuilder.RunTransformations(transformAbortCondition);
			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);
			var outputFormatter = new VBTextOutputFormatter(output);
			var formattingPolicy = new VBFormattingOptions();
			unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
		}