2 implementations of ITemplateConstraint
dotnet (1)
Commands\New\MSBuildEvaluation\ProjectCapabilityConstraint.cs (1)
44
internal class ProjectCapabilityConstraint :
ITemplateConstraint
Microsoft.TemplateEngine.Edge (1)
Constraints\ConstraintBase.cs (1)
9
internal abstract class ConstraintBase :
ITemplateConstraint
33 references to ITemplateConstraint
dotnet (2)
Commands\New\MSBuildEvaluation\ProjectCapabilityConstraint.cs (2)
21
public Task<
ITemplateConstraint
> CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken)
34
return Task.FromResult((
ITemplateConstraint
)new ProjectCapabilityConstraint(environmentSettings, this, evaluationResult));
Microsoft.TemplateEngine.Abstractions (12)
Constraints\ITemplateConstraintFactory.cs (3)
7
/// Template constraint factory used to create and initialize the instance of <see cref="
ITemplateConstraint
"/>.
18
/// Creates and initializes new <see cref="
ITemplateConstraint
"/> based on current <paramref name="environmentSettings"/>.
20
Task<
ITemplateConstraint
> CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken);
Constraints\TemplateConstraintInfo.cs (1)
14
/// <param name="type">Constraint type, matches the type defined in <see cref="
ITemplateConstraint
"/> implementation and template.json.</param>
Constraints\TemplateConstraintResult.cs (7)
13
private TemplateConstraintResult(
ITemplateConstraint
constraint)
32
/// Gets the executed <see cref="
ITemplateConstraint
"/>.
34
public
ITemplateConstraint
? Constraint { get; }
60
public static TemplateConstraintResult CreateAllowed(
ITemplateConstraint
constraint)
74
public static TemplateConstraintResult CreateRestricted(
ITemplateConstraint
constraint, string localizedErrorMessage, string? cta = null)
95
public static TemplateConstraintResult CreateEvaluationFailure(
ITemplateConstraint
constraint, string localizedErrorMessage, string? cta = null)
112
/// If constraint was intiialized, use <see cref="CreateEvaluationFailure(
ITemplateConstraint
, string, string?)"/> instead.
TemplateFiltering\MatchInfo.cs (1)
85
/// Prefix used for <see cref="
ITemplateConstraint
"/> matching.
Microsoft.TemplateEngine.Edge (17)
Constraints\ConfigurationException.cs (1)
9
/// Exception occurred when parsing configuration for <see cref="
ITemplateConstraint
"/>.
Constraints\HostConstraint.cs (2)
17
Task<
ITemplateConstraint
> ITemplateConstraintFactory.CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken)
20
return Task.FromResult((
ITemplateConstraint
)new HostConstraint(environmentSettings, this));
Constraints\OSConstraint.cs (2)
23
Task<
ITemplateConstraint
> ITemplateConstraintFactory.CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken)
26
return Task.FromResult((
ITemplateConstraint
)new OSConstraint(environmentSettings, this));
Constraints\SdkVersionConstraintFactory.cs (1)
17
async Task<
ITemplateConstraint
> ITemplateConstraintFactory.CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken)
Constraints\WorkloadConstraintFactory.cs (1)
20
async Task<
ITemplateConstraint
> ITemplateConstraintFactory.CreateTemplateConstraintAsync(IEngineEnvironmentSettings environmentSettings, CancellationToken cancellationToken)
TemplateConstraintManager.cs (10)
17
private readonly Dictionary<string, Task<
ITemplateConstraint
>> _templateConstrains = new Dictionary<string, Task<
ITemplateConstraint
>>();
33
/// Returns the list of initialized <see cref="
ITemplateConstraint
"/>s.
34
/// Only returns the list of <see cref="
ITemplateConstraint
"/> that were initialized successfully.
39
/// <returns>The list of successfully initialized <see cref="
ITemplateConstraint
"/>s.</returns>
40
public async Task<IReadOnlyList<
ITemplateConstraint
>> GetConstraintsAsync(IEnumerable<ITemplateInfo>? templates = null, CancellationToken cancellationToken = default)
43
IEnumerable<(string Type, Task<
ITemplateConstraint
> Task)> constraintsToInitialize;
94
if (!_templateConstrains.TryGetValue(type, out Task<
ITemplateConstraint
> task))
154
if (!_templateConstrains.TryGetValue(constraintType, out Task<
ITemplateConstraint
> task))
188
if (!_templateConstrains.TryGetValue(constraint.Type, out Task<
ITemplateConstraint
> task))
Microsoft.TemplateEngine.Utils (2)
WellKnownSearchFilters.cs (2)
233
public static IEnumerable<Func<ITemplateInfo, MatchInfo?>> ConstraintFilters(IEnumerable<
ITemplateConstraint
> constraintDefinitions)
235
foreach (
ITemplateConstraint
constraintDefinition in constraintDefinitions)