TemplateManager Class
Namespace: Stride.Core.Assets.TemplatesAssembly: Stride.Core.Assets.dll
Handle templates for creating Package, ProjectReference
public class TemplateManager
Name | Description | |
---|---|---|
Methods | ||
FindTemplateGenerator<TParameters>(TParameters) | Finds a template generator supporting the specified template description |
|
FindTemplateGenerator<TParameters>(TemplateDescription) | Finds a template generator supporting the specified template description |
|
FindTemplates(PackageSession) | Finds all template descriptions. |
|
FindTemplates(TemplateScope, PackageSession) | Finds template descriptions that match the given scope. |
|
Register(ITemplateGenerator) | Registers the specified factory. |
|
RegisterPackage(Package) | ||
Unregister(ITemplateGenerator) | Unregisters the specified factory. |
Methods
FindTemplateGenerator<TParameters>(TParameters)
Finds a template generator supporting the specified template description
public static ITemplateGenerator<TParameters> FindTemplateGenerator<TParameters>(TParameters parameters)
where TParameters : TemplateGeneratorParameters
Parameters
Type | Name | Description |
---|---|---|
TParameters | parameters | The parameters. |
Returns
Type | Description |
---|---|
ITemplateGenerator<TParameters> | A template generator supporting the specified description or null if not found. |
Type Parameters
Name | Description |
---|---|
TParameters |
FindTemplateGenerator<TParameters>(TemplateDescription)
Finds a template generator supporting the specified template description
public static ITemplateGenerator<TParameters> FindTemplateGenerator<TParameters>(TemplateDescription description)
where TParameters : TemplateGeneratorParameters
Parameters
Type | Name | Description |
---|---|---|
TemplateDescription | description | The description. |
Returns
Type | Description |
---|---|
ITemplateGenerator<TParameters> | A template generator supporting the specified description or null if not found. |
Type Parameters
Name | Description |
---|---|
TParameters |
FindTemplates(PackageSession)
Finds all template descriptions.
public static IEnumerable<TemplateDescription> FindTemplates(PackageSession session = null)
Parameters
Type | Name | Description |
---|---|---|
PackageSession | session |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TemplateDescription> | A sequence containing all registered template descriptions. |
FindTemplates(TemplateScope, PackageSession)
Finds template descriptions that match the given scope.
public static IEnumerable<TemplateDescription> FindTemplates(TemplateScope scope, PackageSession session = null)
Parameters
Type | Name | Description |
---|---|---|
TemplateScope | scope | |
PackageSession | session |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TemplateDescription> | A sequence containing all registered template descriptions that match the given scope. |
Register(ITemplateGenerator)
Registers the specified factory.
public static void Register(ITemplateGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ITemplateGenerator | generator | The factory. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | factory |
RegisterPackage(Package)
public static void RegisterPackage(Package package)
Parameters
Type | Name | Description |
---|---|---|
Package | package |
Unregister(ITemplateGenerator)
Unregisters the specified factory.
public static void Unregister(ITemplateGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ITemplateGenerator | generator | The factory. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | factory |