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

This class represents the generated code tree.
This is a customized data structure that is optimized for WSCF code generation purposes. It provides faster access to service contracts, service types, client types, message contracts and data contracts. Furthermore this class provides the common operations for adding new types and substituting one type with another. An instance of this class is handed over to each ICodeDecorator.
显示文件 Open project: WSCF/WSCF Class Usage Examples

Public Methods

Method Description
SubstituteType ( string oldType, CodeTypeDeclaration newType ) : void

Substitutes one type by another.

UnwrapCodeDomTree ( ) : CodeNamespace

Gets the modified CodeDom CodeNamespace instance without additional wrappers. This instance can be used with standard code generation APIs to emit the final code.

Private Methods

Method Description
ExtendTypeMembers ( CodeTypeExtension typeExtension ) : void

This methods adds CodeTypeMemberExtension to all CodeTypeMembers in a given type.

ExtendedCodeDomTree ( CodeNamespace codeNamespace, CodeLanguage codeLanguage, Configuration configuration ) : System

Creates a new instance of GeneratedCode class.

This class can only be initialized by CodeFactory. Therefore this constructor is marked as internal.

ParseAndFilterCodeNamespace ( ) : void

This method contains the core implementation for generating the GeneratedCode instance.

This method decorates every type found in codeNamespace with a CodeTypeMemberExtension. And then it sends each type through series of ITypeFilters to figure out whether the type is a service contract, service type, client type, message contract or data contract.

Method Details

SubstituteType() public method

Substitutes one type by another.
public SubstituteType ( string oldType, CodeTypeDeclaration newType ) : void
oldType string Name of the type to substitute.
newType System.CodeDom.CodeTypeDeclaration CodeTypeDeclaration of the new type.
return void

UnwrapCodeDomTree() public method

Gets the modified CodeDom CodeNamespace instance without additional wrappers. This instance can be used with standard code generation APIs to emit the final code.
public UnwrapCodeDomTree ( ) : CodeNamespace
return System.CodeDom.CodeNamespace