예제 #1
0
        /// <summary>
        /// Copies the Java class dependent on the Destination path and the extensions.
        /// </summary>
        /// <param name="codeSourceDirectory">Save to</param>
        /// <param name="javaCode">To save</param>
        /// <param name="extension">To modify path.</param>
        protected void CopyJavaFile(string codeSourceDirectory, string javaCode, CodeExtension extension)
        {
            //Save the Class to the File wanted:
            string[] directoryPath    = new string[] { codeSourceDirectory };
            string[] packagePathSplit = directoryPath.Concat(extension.Package.Split('.')).ToArray();
            string   javaClassPath    = Path.Combine(packagePathSplit);

            //Create the Directory:
            Directory.CreateDirectory(javaClassPath);
            javaClassPath = Path.Combine(javaClassPath, extension.ClassName + ".java");

            //Finally save:
            File.WriteAllText(javaClassPath, javaCode);
        }
예제 #2
0
        /// <summary>
        /// Saves the Data passed to the directory passed.
        /// </summary>
        /// <param name="directory">To save to</param>
        /// <param name="javaClass">To save</param>
        /// <param name="codeExtension">To use for references</param>
        public void save(string directory, string javaClass, CodeExtension codeExtension)
        {
            if (!codeExporters
                .ExecuteOnFirst(
                    e => e.Supports(directory),
                    e => e.save(directory, javaClass, codeExtension))
                )
            {
                MessageBox.Show("Could not save Code. :(");
                return;
            }

            //Tell the user it worked:
            MessageBox.Show("Code exporting done.", "Exporter");
        }
예제 #3
0
 /// <summary>
 /// Saves the Data passed to the directory passed.
 /// </summary>
 /// <param name="directory">To save to</param>
 /// <param name="javaClass">To save</param>
 /// <param name="codeExtension">To use for references</param>
 public abstract void save(string directory, string javaClass, CodeExtension codeExtension);