public string GenerateInitializeComponentMethodBody(IDesignerHost host, IDesignerSerializationManager serializationManager, string rootNamespace, int initialIndent) { codeBuilder = new PythonCodeBuilder(initialIndent); codeBuilder.IndentString = indentString; CodeMemberMethod method = FindInitializeComponentMethod(host, serializationManager); GetResourceRootName(rootNamespace, host.RootComponent); AppendStatements(method.Statements); return codeBuilder.ToString(); }
public string GenerateInitializeComponentMethodBody(IDesignerHost host, IDesignerSerializationManager serializationManager, string rootNamespace, int initialIndent) { codeBuilder = new PythonCodeBuilder(initialIndent); codeBuilder.IndentString = indentString; CodeMemberMethod method = FindInitializeComponentMethod(host, serializationManager); GetResourceRootName(rootNamespace, host.RootComponent); AppendStatements(method.Statements); return(codeBuilder.ToString()); }
/// <summary> /// Converts the source code to Python. /// </summary> public string Convert(string source, SupportedLanguage language) { // Convert to NRefactory code DOM. CompilationUnit unit = GenerateCompilationUnit(source, language); SpecialOutputVisitor specialOutputVisitor = new SpecialOutputVisitor(this); specialNodesInserter = new SpecialNodesInserter(unit.UserData as List<ISpecial>, specialOutputVisitor); // Convert to Python code. entryPointMethods = new List<MethodDeclaration>(); codeBuilder = new PythonCodeBuilder(); codeBuilder.IndentString = indentString; unit.AcceptVisitor(this, null); return codeBuilder.ToString().Trim(); }
public void Init() { codeBuilder = new PythonCodeBuilder(); codeBuilder.IndentString = "\t"; }