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()); }
public static string ToCSharp(this BaseSyntax node, ApexSharpParserOptions options) => CSharpCodeGenerator.GenerateCSharp(node, options);
public static string ToCSharp(this BaseSyntax node, int tabSize = 4, string @namespace = null) => CSharpCodeGenerator.GenerateCSharp(node, tabSize, @namespace);