TemplateGeneratorParameters Class
Namespace: Stride.Core.Assets.TemplatesAssembly: Stride.Core.Assets.dll
Parameters used by ITemplateGenerator<TParameters>
public abstract class TemplateGeneratorParameters
Name | Description | |
---|---|---|
Constructors | ||
TemplateGeneratorParameters() | ||
TemplateGeneratorParameters(TemplateGeneratorParameters) | ||
Fields | ||
Tags | Contains extra properties that can be consumed by template generators. |
|
Properties | ||
Description | The actual template description. |
|
Id | Gets or sets the project ID used to generate the template. |
|
Logger | Gets or sets the logger. |
|
Name | Gets or sets the project name used to generate the template. |
|
Namespace | Gets or sets the default namespace of this project. |
|
OutputDirectory | Gets or sets the output directory. |
|
Unattended | Specifies if the template generator should run in unattended mode (no UI). |
|
Methods | ||
GetTag<T>(PropertyKey<T>) | Gets the tag corresponding to the given property key. This will fail if key doesn't exist. |
|
HasTag<T>(PropertyKey<T>) | ||
SetTag<T>(PropertyKey<T>, T) | ||
TryGetTag<T>(PropertyKey<T>) | Gets the tag corresponding to the given property key if available, otherwise returns default value. |
|
Validate() | Validates this instance (all fields must be setup) |
|
ValidateParameters() |
Constructors
TemplateGeneratorParameters()
protected TemplateGeneratorParameters()
TemplateGeneratorParameters(TemplateGeneratorParameters)
protected TemplateGeneratorParameters(TemplateGeneratorParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
TemplateGeneratorParameters | parameters |
Fields
Tags
Contains extra properties that can be consumed by template generators.
public PropertyContainer Tags
Field Value
Type | Description |
---|---|
PropertyContainer |
Properties
Description
The actual template description.
public TemplateDescription Description { get; set; }
Property Value
Type | Description |
---|---|
TemplateDescription |
Id
Gets or sets the project ID used to generate the template.
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | The ID |
Logger
Gets or sets the logger.
public LoggerResult Logger { get; set; }
Property Value
Type | Description |
---|---|
LoggerResult | The logger. |
Name
Gets or sets the project name used to generate the template.
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name. |
Namespace
Gets or sets the default namespace of this project.
public string Namespace { get; set; }
Property Value
Type | Description |
---|---|
System.String | The namespace. |
OutputDirectory
Gets or sets the output directory.
public UDirectory OutputDirectory { get; set; }
Property Value
Type | Description |
---|---|
Stride.Core.IO.UDirectory | The output directory. |
Unattended
Specifies if the template generator should run in unattended mode (no UI).
public bool Unattended { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetTag<T>(PropertyKey<T>)
Gets the tag corresponding to the given property key. This will fail if key doesn't exist.
public T GetTag<T>(PropertyKey<T> key)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | The property key for which to retrieve the value. |
Returns
Type | Description |
---|---|
T | The value of the tag corresponding to the given property key. |
Type Parameters
Name | Description |
---|---|
T | The generic type of the property key. |
Exceptions
Type | Condition |
---|---|
System.Collections.Generic.KeyNotFoundException | Tag not found in template generator parameters. |
HasTag<T>(PropertyKey<T>)
public bool HasTag<T>(PropertyKey<T> key)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T |
SetTag<T>(PropertyKey<T>, T)
public void SetTag<T>(PropertyKey<T> key, T value)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | |
T | value |
Type Parameters
Name | Description |
---|---|
T |
TryGetTag<T>(PropertyKey<T>)
Gets the tag corresponding to the given property key if available, otherwise returns default value.
public T TryGetTag<T>(PropertyKey<T> key)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | The property key for which to retrieve the value. |
Returns
Type | Description |
---|---|
T | The value of the tag corresponding to the given property key if available, the default value of the property key otherwise. |
Type Parameters
Name | Description |
---|---|
T | The generic type of the property key. |
Validate()
Validates this instance (all fields must be setup)
public void Validate()
ValidateParameters()
protected virtual void ValidateParameters()