







Add a template generator
Namespace:
HttpServer.Rendering
Assembly:
HttpServer (in HttpServer.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public void Add( string fileExtension, TemplateGenerator generator ) |
| Visual Basic (Declaration) |
|---|
Public Sub Add ( _ fileExtension As String, _ generator As TemplateGenerator _ ) |
| Visual C++ |
|---|
public: void Add( String^ fileExtension, TemplateGenerator^ generator ) |
Parameters
- fileExtension
- Type: System..::.String
File extension without the dot.
- generator
- Type: HttpServer.Rendering..::.TemplateGenerator
Generator to handle the extension
Examples
cache.Add("haml", new HamlGenerator());
Exceptions
| Exception | Condition |
|---|---|
| System..::.InvalidOperationException | If the generator already exists. |
| System..::.ArgumentException | If file extension is incorrect |
| System..::.ArgumentNullException | If generator is not specified. |
