상속: System.CodeDom.Compiler.CodeGenerator
예제 #1
0
        /// <summary>
        /// Compile unit
        /// </summary>
        private string GenerateNamespace()
        {
            var sb           = new StringBuilder();
            var swJavaBuffer = new StringWriter(sb);

            ICodeGenerator codeGenerator = new JavaCodeGenerator();
            var            cop           = new CodeGeneratorOptions();
            var            unit          = new CodeCompileUnit();
            var            nameSpace     = new CodeNamespace(type.JVMNamespaceExt);

            unit.Namespaces.Add(nameSpace);

            Generate(nameSpace);

            codeGenerator.GenerateCodeFromCompileUnit(unit, swJavaBuffer, cop);
            swJavaBuffer.Close();

            sb.Replace("This code was generated by a tool.",
                       "This code was generated by jni4net. See http://jni4net.sourceforge.net/ ");

            return(sb.ToString());
        }
예제 #2
0
        /// <summary>
        /// Compile unit
        /// </summary>
        private string GenerateNamespace()
        {
            var sb = new StringBuilder();
            var swJavaBuffer = new StringWriter(sb);

            ICodeGenerator codeGenerator = new JavaCodeGenerator();
            var cop = new CodeGeneratorOptions();
            var unit = new CodeCompileUnit();
            var nameSpace = new CodeNamespace(type.JVMNamespaceExt);
            unit.Namespaces.Add(nameSpace);

            Generate(nameSpace);

            codeGenerator.GenerateCodeFromCompileUnit(unit, swJavaBuffer, cop);
            swJavaBuffer.Close();

            sb.Replace("This code was generated by a tool.",
                       "This code was generated by jni4net. See http://jni4net.sourceforge.net/ ");

            return sb.ToString();
        }