Thinktecture.Tools.Web.Services.CodeGeneration.CodeWriter.WriteCodeFiles C# (CSharp) Method

WriteCodeFiles() private method

Writes the code to the disk according to the given options.
private WriteCodeFiles ( ) : void
return void
        private void WriteCodeFiles()
        {
            // Ensure the output directory exist in the file system.
            EnsureDirectoryExists(options.OutputLocation);

            // Create the CodeGenerationOptions instance.
            codeGenerationOptions = CodeWriter.CreateCodeGeneratorOptions();

            // Do we have to generate separate files?
            if (options.GenerateSeparateFiles)
            {
                // Write the code into separate files.
                WriteSeparateCodeFiles();
            }
            else
            {
                // Write the code into a singl file.
                WriteSingleCodeFile();
            }

            // Finally write the configuration file.
            if (configuration != null)
            {
                WriteConfigurationFile();
            }
            WriteTextFiles();
        }

Usage Example

Beispiel #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;
 }
All Usage Examples Of Thinktecture.Tools.Web.Services.CodeGeneration.CodeWriter::WriteCodeFiles