This class defines the data structure used to return the CodeWriter output.
Esempio n. 1
0
 /// <summary>
 /// Generates the code using the appropriate code provider and writes it to the 
 /// desired location.
 /// </summary>        
 public static CodeWriterOutput Write(CodeNamespace codeNamespace, Configuration configuration, CodeWriterOptions options, List<TextFile> textFiles, CodeDomProvider provider)
 {
     // Create a new instance of CodeWriter class with given options.
     CodeWriter writer = new CodeWriter(codeNamespace, configuration, options, textFiles, provider);
     // Execute the code writing procedure.
     writer.WriteCodeFiles();
     // Crate an instance of CodeWriterOutput class with the code writer's output.
     CodeWriterOutput output = new CodeWriterOutput(writer.generatedCodeFileNames, writer.configurationFile);
     // Finally return the CodeWriterOutput.
     return output;
 }
Esempio n. 2
0
        /// <summary>
        /// Generates the code using the appropriate code provider and writes it to the
        /// desired location.
        /// </summary>
        public static CodeWriterOutput Write(CodeNamespace codeNamespace, Configuration configuration, CodeWriterOptions options, List <TextFile> textFiles, CodeDomProvider provider)
        {
            // Create a new instance of CodeWriter class with given options.
            CodeWriter writer = new CodeWriter(codeNamespace, configuration, options, textFiles, provider);

            // Execute the code writing procedure.
            writer.WriteCodeFiles();
            // Crate an instance of CodeWriterOutput class with the code writer's output.
            CodeWriterOutput output = new CodeWriterOutput(writer.generatedCodeFileNames, writer.configurationFile);

            // Finally return the CodeWriterOutput.
            return(output);
        }
        private void AddGeneratedFilesToProject(CodeWriterOutput output)
        {
            foreach (string file in output.CodeFileNames)
            {
                currentProject.AddFile(file);
            }
			if (!string.IsNullOrEmpty(output.ConfigurationFile) && File.Exists(output.ConfigurationFile))
			{
				currentProject.AddFile(output.ConfigurationFile);				
			}
        }