1 implementation of ITemplateMatchInfo
Microsoft.TemplateEngine.Edge (1)
Settings\TemplateMatchInfo.cs (1)
63
internal class TemplateMatchInfo : Abstractions.TemplateFiltering.
ITemplateMatchInfo
71 references to ITemplateMatchInfo
Microsoft.TemplateEngine.Cli (30)
TemplateResolution\TemplateGroupMatchInfo.cs (25)
23
private readonly IReadOnlyList<
ITemplateMatchInfo
> _templateMatchInfos;
30
IEnumerable<
ITemplateMatchInfo
> templateDispositions,
73
/// Returns the list of <see cref="
ITemplateMatchInfo
"></see> for all templates in the group.
75
internal IEnumerable<
ITemplateMatchInfo
> TemplateMatchInfos
85
return Array.Empty<
ITemplateMatchInfo
>();
92
/// Returns the list of <see cref="
ITemplateMatchInfo
"></see> for all templates that matches template info filters.
94
internal IEnumerable<
ITemplateMatchInfo
> TemplateMatchInfosWithMatchingInfo
104
return Array.Empty<
ITemplateMatchInfo
>();
111
/// Returns the list of <see cref="
ITemplateMatchInfo
"></see> for all templates that matches template info filters and template options filters.
113
internal IEnumerable<
ITemplateMatchInfo
> TemplateMatchInfosWithMatchingParameters
127
return Array.Empty<
ITemplateMatchInfo
>();
134
/// Returns the list of <see cref="
ITemplateMatchInfo
"></see> for all templates of preferred language that matches template info filters, template options filters.
136
internal IEnumerable<
ITemplateMatchInfo
> TemplateMatchInfosWithMatchingParametersForPreferredLanguage
150
return Array.Empty<
ITemplateMatchInfo
>();
213
Array.Empty<
ITemplateMatchInfo
>(),
218
IReadOnlyCollection<
ITemplateMatchInfo
> templateMatchDispositions = TemplateListFilter.GetTemplateMatchInfo(group.Templates, x => true, templateInfoFilters.ToArray());
231
foreach (
var
template in templateMatchDispositions)
267
foreach (
ITemplateMatchInfo
template in _templateMatchInfos)
291
private static bool TemplateInfoMatch(
ITemplateMatchInfo
templateMatchInfo)
298
private static bool TemplateParametersMatch(
ITemplateMatchInfo
templateMatchInfo)
305
private IEnumerable<
ITemplateMatchInfo
> GetHighestPrecedenceTemplateMatchInfos()
309
return new List<
ITemplateMatchInfo
>();
312
IEnumerable<
ITemplateMatchInfo
> templatesToCheck = FilterTemplatesByPreferredLanguage(TemplateMatchInfosWithMatchingParameters);
318
private IEnumerable<
ITemplateMatchInfo
> FilterTemplatesByPreferredLanguage(IEnumerable<
ITemplateMatchInfo
> templatesToFilter)
TemplateResolution\TemplateMatchInfoExtensions.cs (4)
12
internal static IReadOnlyDictionary<string, string?> GetValidTemplateParameters(this
ITemplateMatchInfo
templateMatchInfo)
20
internal static IEnumerable<string> GetInvalidParameterNames(this
ITemplateMatchInfo
templateMatchInfo)
28
internal static bool HasMismatchOnConstraints(this
ITemplateMatchInfo
templateMatchInfo)
45
internal static bool HasMismatchOnListFilters(this
ITemplateMatchInfo
templateMatchInfo)
TemplateResolution\TemplateResolutionResult.cs (1)
261
internal static IReadOnlyDictionary<string, string?> GetAllMatchedParametersList(IEnumerable<
ITemplateMatchInfo
> templateMatchInfos)
Microsoft.TemplateEngine.Edge (13)
Settings\TemplatePackageManager.cs (3)
164
/// <param name="matchFilter">The criteria for <see cref="
ITemplateMatchInfo
"/> to be included to result collection.</param>
172
public async Task<IReadOnlyList<
ITemplateMatchInfo
>> GetTemplatesAsync(Func<
ITemplateMatchInfo
, bool> matchFilter, IEnumerable<Func<ITemplateInfo, MatchInfo?>> filters, CancellationToken cancellationToken)
TemplateListFilter.cs (10)
106
public static IReadOnlyCollection<Abstractions.TemplateFiltering.
ITemplateMatchInfo
> GetTemplateMatchInfo(IReadOnlyList<ITemplateInfo> templateList, Func<Abstractions.TemplateFiltering.
ITemplateMatchInfo
, bool> matchFilter, params Func<ITemplateInfo, Abstractions.TemplateFiltering.MatchInfo?>[] filters)
108
HashSet<Abstractions.TemplateFiltering.
ITemplateMatchInfo
> matchingTemplates = new HashSet<Abstractions.TemplateFiltering.
ITemplateMatchInfo
>(TemplateMatchInfoEqualityComparer.Default);
123
Abstractions.TemplateFiltering.
ITemplateMatchInfo
info = new TemplateMatchInfo(template, matchInformation);
137
private class TemplateMatchInfoEqualityComparer : IEqualityComparer<Abstractions.TemplateFiltering.
ITemplateMatchInfo
>
139
internal static IEqualityComparer<Abstractions.TemplateFiltering.
ITemplateMatchInfo
> Default { get; } = new TemplateMatchInfoEqualityComparer();
141
public bool Equals(Abstractions.TemplateFiltering.
ITemplateMatchInfo
x, Abstractions.TemplateFiltering.
ITemplateMatchInfo
y)
146
public int GetHashCode(Abstractions.TemplateFiltering.
ITemplateMatchInfo
obj)
Microsoft.TemplateEngine.IDE (3)
Bootstrapper.cs (3)
15
using ITemplateMatchInfo = Microsoft.TemplateEngine.Abstractions.TemplateFiltering.
ITemplateMatchInfo
;
116
public Task<IReadOnlyList<
ITemplateMatchInfo
>> GetTemplatesAsync(IEnumerable<Func<ITemplateInfo, MatchInfo?>> filters, bool exactMatchesOnly = true, CancellationToken cancellationToken = default)
118
Func<
ITemplateMatchInfo
, bool> criteria;
Microsoft.TemplateEngine.Utils (25)
TemplateMatchInfoExtensions.cs (21)
9
/// Set of useful extensions when working with <see cref="
ITemplateMatchInfo
"/>.
16
public static bool HasNameMatch(this
ITemplateMatchInfo
templateMatchInfo)
24
public static bool HasNameExactMatch(this
ITemplateMatchInfo
templateMatchInfo)
32
public static bool HasNamePartialMatch(this
ITemplateMatchInfo
templateMatchInfo)
40
public static bool HasNameMismatch(this
ITemplateMatchInfo
templateMatchInfo)
48
public static bool HasShortNameMatch(this
ITemplateMatchInfo
templateMatchInfo)
56
public static bool HasShortNameExactMatch(this
ITemplateMatchInfo
templateMatchInfo)
64
public static bool HasShortNamePartialMatch(this
ITemplateMatchInfo
templateMatchInfo)
72
public static bool HasShortNameMismatch(this
ITemplateMatchInfo
templateMatchInfo)
80
public static bool HasTypeMatch(this
ITemplateMatchInfo
templateMatchInfo)
88
public static bool HasTypeMismatch(this
ITemplateMatchInfo
templateMatchInfo)
96
public static bool HasClassificationMatch(this
ITemplateMatchInfo
templateMatchInfo)
104
public static bool HasClassificationMismatch(this
ITemplateMatchInfo
templateMatchInfo)
112
public static bool HasLanguageMatch(this
ITemplateMatchInfo
templateMatchInfo)
120
public static bool HasLanguageMismatch(this
ITemplateMatchInfo
templateMatchInfo)
128
public static bool HasBaselineMatch(this
ITemplateMatchInfo
templateMatchInfo)
136
public static bool HasBaselineMismatch(this
ITemplateMatchInfo
templateMatchInfo)
144
public static bool HasAuthorMatch(this
ITemplateMatchInfo
templateMatchInfo)
152
public static bool HasAuthorExactMatch(this
ITemplateMatchInfo
templateMatchInfo)
160
public static bool HasAuthorPartialMatch(this
ITemplateMatchInfo
templateMatchInfo)
168
public static bool HasAuthorMismatch(this
ITemplateMatchInfo
templateMatchInfo)
WellKnownSearchFilters.cs (4)
16
/// The template should match all filters: <see cref="
ITemplateMatchInfo
.MatchDisposition"/> should have all dispositions of <see cref="MatchKind.Exact"/> or <see cref="MatchKind.Partial"/>.
18
public static Func<
ITemplateMatchInfo
, bool> MatchesAllCriteria =>
22
/// The template should match at least one filter: <see cref="
ITemplateMatchInfo
.MatchDisposition"/> should have at least one disposition of <see cref="MatchKind.Exact"/> or <see cref="MatchKind.Partial"/>.
24
public static Func<
ITemplateMatchInfo
, bool> MatchesAtLeastOneCriteria =>