public static string GenerateCSharp(BaseSyntax ast, ApexSharpParserOptions options)
        {
            // set default options
            options = options ?? new ApexSharpParserOptions();

            var generator = new CSharpCodeGenerator
            {
                IndentSize = options.TabSize,
                Namespace  = options.Namespace,
                UseLocalSObjectsNamespace = options.UseLocalSObjectsNamespace,
            };

            ast.Accept(generator);
            return(generator.Code.ToString());
        }
Example #2
0
 public static string ToCSharp(this BaseSyntax node, ApexSharpParserOptions options) =>
 CSharpCodeGenerator.GenerateCSharp(node, options);
Example #3
0
 public static string ToCSharp(this BaseSyntax node, int tabSize = 4, string @namespace = null) =>
 CSharpCodeGenerator.GenerateCSharp(node, tabSize, @namespace);