コード例 #1
0
		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();
		}
コード例 #2
0
        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());
        }
コード例 #3
0
		/// <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();
		}
コード例 #4
0
		public void Init()
		{
			codeBuilder = new PythonCodeBuilder();
			codeBuilder.IndentString = "\t";
		}