CodeCompileUnit ParseForm()
		{
			ParseInformation parseInfo = ParserService.ParseFile(this.Generator.ViewContent.DesignerCodeFile.FileName, this.Generator.ViewContent.DesignerCodeFileContent, false);
			Module module = ParseFormAsModule();
			
			#if DEBUG
			Console.WriteLine(module.ToCodeString());
			#endif
			
			CodeDomVisitor visitor = new CodeDomVisitor(parseInfo.MostRecentCompilationUnit.ProjectContent);
			module.Accept(visitor);
			
			#if DEBUG
			// output generated CodeDOM to the console :
			ICSharpCode.NRefactory.Visitors.CodeDomVerboseOutputGenerator outputGenerator = new ICSharpCode.NRefactory.Visitors.CodeDomVerboseOutputGenerator();
			outputGenerator.GenerateCodeFromMember(visitor.OutputCompileUnit.Namespaces[0].Types[0], Console.Out, null);
			CodeDomProvider cSharpProvider = new Microsoft.CSharp.CSharpCodeProvider();
			cSharpProvider.GenerateCodeFromCompileUnit(visitor.OutputCompileUnit, Console.Out, null);
			#endif
			
			return visitor.OutputCompileUnit;
		}
Exemplo n.º 2
0
        CodeCompileUnit ParseForm()
        {
            ParseInformation parseInfo = ParserService.ParseFile(this.Generator.ViewContent.DesignerCodeFile.FileName, this.Generator.ViewContent.DesignerCodeFileContent, false);
            Module           module    = ParseFormAsModule();

                        #if DEBUG
            Console.WriteLine(module.ToCodeString());
                        #endif

            CodeDomVisitor visitor = new CodeDomVisitor(parseInfo.MostRecentCompilationUnit.ProjectContent);
            module.Accept(visitor);

                        #if DEBUG
            // output generated CodeDOM to the console :
            ICSharpCode.NRefactory.Visitors.CodeDomVerboseOutputGenerator outputGenerator = new ICSharpCode.NRefactory.Visitors.CodeDomVerboseOutputGenerator();
            outputGenerator.GenerateCodeFromMember(visitor.OutputCompileUnit.Namespaces[0].Types[0], Console.Out, null);
            CodeDomProvider cSharpProvider = new Microsoft.CSharp.CSharpCodeProvider();
            cSharpProvider.GenerateCodeFromCompileUnit(visitor.OutputCompileUnit, Console.Out, null);
                        #endif

            return(visitor.OutputCompileUnit);
        }