C# Class Thinktecture.Tools.Web.Services.CodeGeneration.CodeWriter

This class implements the methods that are required to produce the final code out of the CodeDom object graph and write the generated code in to the desired location.
ファイルを表示 Open project: WSCF/WSCF Class Usage Examples

Public Methods

Method Description
Write ( CodeNamespace codeNamespace, Configuration configuration, CodeWriterOptions options, List textFiles, CodeDomProvider provider ) : CodeWriterOutput

Generates the code using the appropriate code provider and writes it to the desired location.

Private Methods

Method Description
CodeWriter ( CodeNamespace codeNamespace, Configuration configuration, CodeWriterOptions options, List textFiles, CodeDomProvider provider ) : System.CodeDom

Private constructor.

CreateCodeGeneratorOptions ( ) : CodeGeneratorOptions

This is a helper method to create an instance of CodeGeneratorOptions class with desired code generation options.

EnsureDirectoryExists ( string directory ) : void

This is a helper method to ensure that a given directory exists in the file system.

If the specified directory does not exist in the file system this method creates it before returning.

GetExtension ( CodeLanguage language ) : string

Helper method to get the code file extension for a given programming language.

GetUniqueFileName ( string directory, string fileName, CodeLanguage language, bool overwrite ) : string

This is a helper method for acquiring a unique file name.

WriteCodeFiles ( ) : void

Writes the code to the disk according to the given options.

WriteConfigurationFile ( ) : void
WriteSeparateCodeFiles ( ) : void

This method writes each type generated into a separate file. The type name is used as the file name.

WriteSingleCodeFile ( ) : void

This method writes the generated code into a single file.

WriteTextFiles ( ) : void

Method Details

Write() public static method

Generates the code using the appropriate code provider and writes it to the desired location.
public static Write ( CodeNamespace codeNamespace, Configuration configuration, CodeWriterOptions options, List textFiles, CodeDomProvider provider ) : CodeWriterOutput
codeNamespace System.CodeDom.CodeNamespace
configuration System.Configuration.Configuration
options CodeWriterOptions
textFiles List
provider System.CodeDom.Compiler.CodeDomProvider
return CodeWriterOutput